Subscribe to Metaphorically Speaking        RSS Feed
-----

And We're back

Icon 1 Comments
So, I haven't really updated my blog in a bit because the power unit
in my PC went down and I had to wait to get paid before I could purchase
a new one. I feel bad because I was in zero contact with my cohort and
I have no idea where he is in the project right now. (Honestly wouldn't
be surprised if he has passed me up by now)

Well anyway I have begun work on what I was originally supposed to work
on the unit and weapon class. So far all I have is the header file but it is rough
outline of what the units and weapon classes will be composed of.

units.h (Specifically holds the unit and weapon class)

class weapon
{
public:
	//constructors
	weapon();
	weapon(string name, int ID, char type, int minRange, int maxRange, int force);
	
	//return values of items in the weapon class 
	string retName();
	int retID();
	char retType();
	int retminRange();
	int retmaxRange();
	int retForce();
	
private:
	string wName; //string to show name of the exact weapon
	int wID; //numerical ID for quick organization
	char wType; // use things like 'S' for sword and 'B' bow 'P' polearm etc
	int wminRange; //the closest the target can be from the weapon before it becomes less useful
	int wmaxRange; //the farthest the target can be from the weapon before it becomes less useful if not useful at all
	int force; //The amount of power it adds the unit

};

class unit
{
public:
	//constructors
	unit();
	unit(string name, int ID, weapon mWeapon, int attackOne, weapon rWeapon, int attackTwo, int xp);
	
	//add xp (TO BE USED LATER)
	void addXP(int someXP);

	//return values
	string retName();
	int retID();
	weapon retmWeapon();
	int retattackOne();
	weapon retrWeapon();
	int retattackTwo();
	int retXP();
	
	

private:
	string uName; //string name to display a unit name to the user
	int uID; //numerical id for quick organization
	weapon umWeapon; //using the weapon class i can store a ranged weapon here
	int uattackOne; // the strength of the units melee attack plus whatever the force of the weapon is
	weapon urWeapon; // using weapon class i can store a ranged weapon here
	int uattackTwo; // the strength of the units ranged attack plus whatever the force of the weapon is
	int uXP;

};




That is what I have so far so please let me know what you think and any ideas or suggestions you may have.

1 Comments On This Entry

Page 1 of 1

Martyr2 

04 July 2009 - 10:49 PM
Looks like a good start to me. The only advice I have is to remember to keep extensibility in mind for the future because both weapons and units will be two classes that you will find yourself upgrading a lot if your game is successful. So take the extra time on them to make sure that it is easy to add extra attributes (enchant a weapons for instance? Durability?) and add new unit types based on those two classes.

:^:
0
Page 1 of 1

Recent Entries

Recent Comments

Search My Blog

January 2022

S M T W T F S
      1
2345678
9101112131415
1617181920 21 22
23242526272829
3031     

Files Used In Blog

1 user(s) viewing

1 Guests
0 member(s)
0 anonymous member(s)