func NewEntity(e interfaces.Entity) *Entity { se := &Entity{} se.EntityId = e.GetEntityId() se.Name = e.GetName() se.Type = e.GetType() se.Subtype = e.GetSubtype() se.MaxArdour = e.GetMaxArdour() se.Ardour = e.GetArdour() se.BoardId, se.X, se.Y = e.GetPosition() se.ActionQueue = e.GetStringActionQueue() return se }
func (g *Game) GetPlayerByEntity(entity interfaces.Entity) interfaces.Player { for player, ent := range g.PlayersToEntities { if ent.GetEntityId() == entity.GetEntityId() { return player } } return nil }
func (g *Game) AddEntity(entity interfaces.Entity) { g.Entities[entity.GetEntityId()] = entity }