Skip to main content
Tweeted twitter.com/StackGameDev/status/658152456862437376
added 9 characters in body; edited title
Source Link
concept3d
  • 12.7k
  • 4
  • 45
  • 57

How do you structure aan Item class?

I've been thinking about the structure of aan Item class. There are many itemitems which may or may not have effects in gamesthe game.

For example, an item "Herb" has an effect to "Heal HP by 5". but an item "Stone" has no effect.

As per a title, when you design a game, how do you structure the Item class?

The following is the structure I've come up with.

class Item{
    String id;
    // Status where s = HP, MP, ATK .. etc
    // Integer -> value which affects on the Status
    Map<Status, Integer> effect;
    SignType st; // +, -, *, /
}

class Player{
    Map<Status, Integer> status; // Status where s = HP, MP, ATK .. etc
}

How do you structure a Item class?

I've been thinking about the structure of a Item class. There are many item which may or may not have effects in games.

For example, an item "Herb" has effect "Heal HP by 5". but an item "Stone" has no effect.

As per a title, when you design a game, how do you structure the Item class?

The following is the structure I've come up with.

class Item{
    String id;
    // Status where s = HP, MP, ATK .. etc
    // Integer -> value which affects on the Status
    Map<Status, Integer> effect;
    SignType st; // +, -, *, /
}

class Player{
    Map<Status, Integer> status; // Status where s = HP, MP, ATK .. etc
}

How do you structure an Item class?

I've been thinking about the structure of an Item class. There are many items which may or may not have effects in the game.

For example, an item "Herb" has an effect to "Heal HP by 5". but an item "Stone" has no effect.

As per a title, when you design a game, how do you structure the Item class?

The following is the structure I've come up with.

class Item{
    String id;
    // Status where s = HP, MP, ATK .. etc
    // Integer -> value which affects on the Status
    Map<Status, Integer> effect;
    SignType st; // +, -, *, /
}

class Player{
    Map<Status, Integer> status; // Status where s = HP, MP, ATK .. etc
}

I've been thinking about the structure of a Item class. There are many item which may or may not have effects in games.

For example, an item "Herb" has effect "Heal HP by 5". but an item "Stone" has no effect.

As per a title, when you design a game, how do you structure the Item class?

The following is the structure I've come up with.

class Item{ String id; // Status where s = HP, MP, ATK .. etc // Integer -> value which affects on the Status Map<Status, Integer> effect; SignType st; // +, -, *, / }

class Player{ Map<Status, Integer> status; // Status where s = HP, MP, ATK .. etc }

class Item{
    String id;
    // Status where s = HP, MP, ATK .. etc
    // Integer -> value which affects on the Status
    Map<Status, Integer> effect;
    SignType st; // +, -, *, /
}

class Player{
    Map<Status, Integer> status; // Status where s = HP, MP, ATK .. etc
}

I've been thinking about the structure of a Item class. There are many item which may or may not have effects in games.

For example, an item "Herb" has effect "Heal HP by 5". but an item "Stone" has no effect.

As per a title, when you design a game, how do you structure the Item class?

The following is the structure I've come up with.

class Item{ String id; // Status where s = HP, MP, ATK .. etc // Integer -> value which affects on the Status Map<Status, Integer> effect; SignType st; // +, -, *, / }

class Player{ Map<Status, Integer> status; // Status where s = HP, MP, ATK .. etc }

I've been thinking about the structure of a Item class. There are many item which may or may not have effects in games.

For example, an item "Herb" has effect "Heal HP by 5". but an item "Stone" has no effect.

As per a title, when you design a game, how do you structure the Item class?

The following is the structure I've come up with.

class Item{
    String id;
    // Status where s = HP, MP, ATK .. etc
    // Integer -> value which affects on the Status
    Map<Status, Integer> effect;
    SignType st; // +, -, *, /
}

class Player{
    Map<Status, Integer> status; // Status where s = HP, MP, ATK .. etc
}
Source Link
neko
  • 107
  • 8

How do you structure a Item class?

I've been thinking about the structure of a Item class. There are many item which may or may not have effects in games.

For example, an item "Herb" has effect "Heal HP by 5". but an item "Stone" has no effect.

As per a title, when you design a game, how do you structure the Item class?

The following is the structure I've come up with.

class Item{ String id; // Status where s = HP, MP, ATK .. etc // Integer -> value which affects on the Status Map<Status, Integer> effect; SignType st; // +, -, *, / }

class Player{ Map<Status, Integer> status; // Status where s = HP, MP, ATK .. etc }