Edit: gfreak
pokemon attacks don't level, I was referring to their stats (attack, spec attack, etc), although there are items that can increase the maximum PP of moves, I don't remember their names but essentially a 5 PP move would become a 8 PP move, for that pokemon only of course.
I understand that cipher, but imagine if programmers didn't have loops but could use recursive functions, would that make it easier or harder for the programmer? the same goes for having to constantly delete memory, perhaps not easier/harder, and I'm sure there are some situations where it is best to use it or it wouldn't even be there, but if you can avoid it by doing it another way, then why not avoid it? IMO having to add a whole extra line each time you use dynamic memory would annoy me endlessly.
Okay, here is your code cipher:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
class attack
{
private:
std::string mName;
int mPower, mPP, mAccuracy;
public:
attack(const std::string& inName, int inPower, int inPP, int inAccuracy);
~attack() {}
};
attack::attack(const std::string& inName, int inPower, int inPP, int inAccuracy)
{
mName = inName;
mPower = inPower;
mPP = inPP;
mAccuracy = inAccuracy;
}
int main()
{
attack *att1 = new attack("HydroPump", 120, 5, 75);
attack *att2 = new attack("Ember", 40, 30, 95);
...
delete att1;
delete att2;
return 0;
}
|
how would you assign Hydropump to slot 3 without redefining it? for example, not like this:
1 2 3 4 5
|
...
attack *att1 = new attack("HydroPump", 120, 5, 75);
attack *att2 = new attack("Ember", 40, 30, 95);
attack *att3 = new attack("HydroPump", 120, 5, 75);
...
|
I'm not trying to be annoying, sorry if it seems that way, I just really want to know how, I don't often get to be in a situation of 'interactive dynamic learning' and I'm finding it hard to understand how you would use a pointer for reusing that definition, so when I get the chance to prod someone about something, I like to take it :b
how would you add new moves without adding code to the program if you aren't using a scripting language or editing a file?