Esempio n. 1
0
        public EntityStruct GetLastSighting(EntityStruct entity)
        {
            foreach (var e in entities)
            {
                if (e.entity.id == entity.id)
                {
                    return e.entity;
                }
            }

            return entity;
        }
Esempio n. 2
0
        public float GetLastSightingTime(EntityStruct entity)
        {
            foreach (var e in entities)
            {
                if (e.entity.id == entity.id)
                {

                    return e.lastSeen;
                }
            }

            return 0;
        }
Esempio n. 3
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
            });
        }
Esempio n. 4
0
 public virtual bool IsHostile(EntityStruct struc)
 {
     return !_team.OnTeam(struc);
 }
Esempio n. 5
0
 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);
 }
Esempio n. 6
0
 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;
        }