29. Tips & tricks
Связи между Entity:
references
IDs
Managers
System data
•
•
•
•
30. Пример: инвентарь
public class InventoryComponent: IComponent
{
public List<Entity> Items { get; set; }
}
public class InventoryItemComponent: IComponent
{
public Entity Inventory { get; set; }
}
public class InventoryManager
{
private Dictionary<Entity, List<Entity>> inventories;
}
31. Пример: Заклинания
•
•
•
•
•
•
Удар молнии = Position + Damage + Attacking
Камнепад
= Position + Damage + AoE + Attacking
Мина
= Position + Damage + AoE
Бомба с фитилем = Position + Damage + AoE +
Expires + AttackOnExpires
Болото
= Position + AoE + Expires + BuffSource
Усиление = Position + AoE + Expires(0) + BuffSource
33. “Build games, not engines”
“A game is just a real-time
database with a pretty
graphical front end.”
“Entity Systems are the
future of MMOs”
“Do not try and bend the spoon
- that's impossible. Instead, only
try to realize the truth… There is
no spoon.”
“Build games, not elaborate component systems!”
maximusya@tut.by