Sign in to follow this  
  • entries
    686
  • comments
    1952
  • views
    386209
Sign in to follow this  


8 Comments


Recommended Comments

Unrelated to the topic but I noticed your code below..

Do you know much about the STL Stompy? If not I would seriously suggest you take a bit of time to learn about std::vector as you'll find a billion places to use it. The same is true for std::map.

You'll stop using arrays for a lot of things. For instance your state stack can be implemented using a vector (although there are better containers to use the vector will be easiest to get to grips with)

std::vector<state> States;

Share this comment


Link to comment
Quote:
Original post by Metorical
Unrelated to the topic but I noticed your code below..

Do you know much about the STL Stompy? If not I would seriously suggest you take a bit of time to learn about std::vector as you'll find a billion places to use it. The same is true for std::map.

You'll stop using arrays for a lot of things. For instance your state stack can be implemented using a vector (although there are better containers to use the vector will be easiest to get to grips with)

std::vector<state> States;


The last entry is C# code, so I don't really know the different libraries yet. That was code from my 4E5 entry.

However, the code for Stompy's Revenge uses the STL almost everywhere. All the enemies are stored in a vector, the states are stored in a std::map. As a C++ programmer, I use it alot, but hopefully I can find the equivelent C# libraries.

Share this comment


Link to comment
C# has a templated class named LinkedList<> (.NET 2.0 only I believe). But it doesn't have an index accessor; other than that it's pretty useful.

Edit: They also have a growable array of some sort.
Edit: Looks like the growable array is List<>.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now