示例#1
0
文件: Map.cs 项目: tylermenezes/ROIDS
 public void AddObject(WorldObject obj)
 {
     WorldObjects.Add(obj);
     if (obj is IPlayer)
         Player = (IPlayer)obj;
     if (obj is IDynamicObject)
         DynamicObjects.Add((IDynamicObject)obj);
 }
示例#2
0
 private bool isWithinSight(WorldObject worldObject, float sightRadiusSq)
 {
     return
         Math.Pow(worldObject.Position.X - _position.X, 2) + Math.Pow(worldObject.Position.Y - _position.Y, 2)
         < sightRadiusSq;
 }
示例#3
0
文件: Map.cs 项目: tylermenezes/ROIDS
 /// <summary>
 /// Safely Destroy Even in ForEach
 /// </summary>
 /// <param name="obj"></param>
 public void SafelyRemoveObject(WorldObject obj)
 {
     _removalList.Add(obj);
 }
示例#4
0
        void goodRoid_Destroyed(WorldObject obj)
        {
            PlayerProfile.CurrentGoodNumber -= 1;

            if (PlayerProfile.CurrentGoodNumber == (PlayerProfile.RoidsToNotBlast - 3))
                Death();
        }
示例#5
0
        void badRoid_Destroyed(WorldObject obj)
        {
            PlayerProfile.RoidsToBlast -= 1;

            if (PlayerProfile.RoidsToBlast == 0)
                EndGame();
            else
                this.Write("Roids to Blast: {0}", PlayerProfile.RoidsToBlast);
        }