Archived

This topic is now archived and is closed to further replies.

RSteel

Stats

Recommended Posts

RSteel    122
I am trying to develop a simple hex game like ogre. How would you all suggest I store the stats for each piece ie...Attack, defense, movement points, ect... in C# Enums, Index Arrays, ArrayList ? Thanks for any advice RSteel

Share this post


Link to post
Share on other sites
Mike737    122
I've never played orge myself, but from a personal opinion I would either create a struct or class to store them in. I would recommend a struct more than a class as it is used for less complex problems.


public struct Stats
{
public int attack;
public int defense;
public int movement;

// Constructor:
public Stats()
{
this.attack = 0;
this.defense = 0;
this.movement = 0;
}

etc.....
}




----
Mike
Portfolio: Http://members.iinet.net.au/~slyons
Team AI: Http://members.iinet.net.au/~slyons/teamai



[edited by - Mike737 on January 6, 2004 2:47:23 AM]

Share this post


Link to post
Share on other sites
RSteel    122
Thanks,

Ogre is like a hex style tile game. Each individual piece ie...tank...infantry...ect..has movement points, attack pts..def...ect..

How would you go about storing each piece with its information, to be called upon? I was thinking about instantiating an object, filling the object with the information and storing it in an array. Is there an easier way?



Thanks for any help
RSteel

Share this post


Link to post
Share on other sites