public EntityStruct GetLastSighting(EntityStruct entity) { foreach (var e in entities) { if (e.entity.id == entity.id) { return e.entity; } } return entity; }
public float GetLastSightingTime(EntityStruct entity) { foreach (var e in entities) { if (e.entity.id == entity.id) { return e.lastSeen; } } return 0; }
private void CompareEntities(EntityStruct entity, float timestamp) { foreach (var e in entities) { if (e.entity.id == entity.id) { e.entity = entity; e.lastSeen = timestamp; return; } } entities.Add(new SightEntity() { lastSeen = timestamp, entity = entity }); }
public virtual bool IsHostile(EntityStruct struc) { return !_team.OnTeam(struc); }
public static void DrawEntity(AtlasGlobal atlas, EntityStruct entity, Color color) { atlas.Graphics.DrawSprite(atlas.Content.GetContent<Texture2D>("image/simple"), entity.position, null, Color.Lerp(color, Color.Black, entity.crouching ? 0.25f : 0), Vector2.One * 16, entity.angle - MathHelper.PiOver2, entity.radius / 16); }
public bool OnTeam(EntityStruct struc) { foreach (var e in _teamArray) { if (struc.Is(e)) return true; } return false; }
public EntityStatus GetEntityStatus(EntityStruct entity) { if (Team.OnTeam(entity)) return EntityStatus.Ally; if (entity.type == typeof(VictoryComputerEntity)) return EntityStatus.Goal; return EntityStatus.Enemy; }