|
This week I will start with some good professional work:
During this past week I have gotten the WeaponManager to correctly work.
In order to make the std::map in my favor I needed the pointer* in the class I wanted to use weapon to make a new weapon and a new weaponManager.
Like this bellow as you can see I have added a Weapon* pointer in order to even find the data I thought was there to begin with.
You hit and miss sometimes and I thank my friend for giving me the quick help of 15 minutes. I used a week in order to get that to work. I would have asked for help with this earlier but every time I thought I fixed the problem a new error window opened up until I got stuck on the picture from my last post,
Now I have gotten some question about why I did a weaponManager and here is the answer:
In order to keep the data and use it in the right way I need a manager that handles the data that exist in the class Weapon.
So that when I later add items and have a equipManager I can retrieve the correct data that I need with almost no work at all. Simple and processed neatly and that is what I have done. I tested it out by adding the weaponManager and a Weapon class in the Player class and added restriction with the magazine size and the it worked out perfectly.
Now I am working with the equipManager now what is that you might ask and I will tell you:
The equipManager is a manager that manages all the items you can pick up in the map and in the future will use only a ItemManager in order to have the use well.
In the picture at the top of this text you can see something with the description //Pollymorphis. Now that is the converting of one type of class into an other so it will add the weapons into Item in order for less work to be needed by the weaponManager. It was what I got from my lead programmer, atleast that is what I think he meant by it.
What I have managed to do in the equipManager was to make ”slots” they are purely virtual right now so showing you a little more than code that is hard to understand you have to wait for a graphic picture to show you.
What I’m working on now is to make a it that a spawned weapon on the ground will be picked up deleted from the map and then added into the equipManager so I can use ”q” in order to switch between our two slot inventory. The hard part have been to get the Player and sprite of the ”items” that is on the map and the code part I don’t manage to use correctly is this one:
So I will work on it during this weekend in order to make it into the play testing now on Monday and on Friday next week we must have a fully functioning beta version. I hope it will work out fine, and I am not afraid to ask for help now because a week on a problem will never happen without some help again and if help is there and the problem persist I will delete that code and start over because then it will be unsolvable.

|