Exemple #1
0
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
}
Exemple #2
0
func (g *Game) GetPlayerByEntity(entity interfaces.Entity) interfaces.Player {
	for player, ent := range g.PlayersToEntities {
		if ent.GetEntityId() == entity.GetEntityId() {
			return player
		}
	}

	return nil
}
Exemple #3
0
func (g *Game) AddEntity(entity interfaces.Entity) {
	g.Entities[entity.GetEntityId()] = entity
}