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

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

                    return e.lastSeen;
                }
            }

            return 0;
        }
예제 #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
            });
        }
예제 #4
0
 public virtual bool IsHostile(EntityStruct struc)
 {
     return !_team.OnTeam(struc);
 }
예제 #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);
 }
예제 #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;
        }