Ejemplo n.º 1
0
 public override void CollidedByObject(Physics phy)
 {
     if (m_canPenetrate == false && phy is SimpleBomb)
     {
         ((SimpleBomb)phy).Bomb();
     }
 }
Ejemplo n.º 2
0
 public override void CollidedByObject(Physics phy)
 {
     if (phy is SimpleBomb)
     {
         SimpleBomb bomb = phy as SimpleBomb;
         bomb.Owner.PickBox(this);
     }
 }
Ejemplo n.º 3
0
 public void AddPhysical(Physics phy)
 {
     phy.SetMap(this);
     lock (_objects)
     {
         _objects.Add(phy);
     }
 }
Ejemplo n.º 4
0
 internal void SendPhysicalObjFocus(Physics obj, int type)
 {
     GSPacketIn pkg = new GSPacketIn((byte)ePackageType.GAME_CMD);
     pkg.WriteByte((byte)eTankCmdType.FOCUS_ON_OBJECT);
     pkg.WriteInt(type);
     pkg.WriteInt(obj.X);
     pkg.WriteInt(obj.Y);
     SendToAll(pkg);
 }
Ejemplo n.º 5
0
 protected virtual void CollideObjects(Physics[] list)
 {
 }
Ejemplo n.º 6
0
 public override void CollidedByObject(Physics phy)
 {
     if (phy is SimpleBomb)
     {
         ((SimpleBomb)phy).Bomb();
     }
 }
Ejemplo n.º 7
0
 public Physics[] FindPhysicalObjects(Rectangle rect, Physics except)
 {
     List<Physics> list = new List<Physics>();
     lock (_objects)
     {
         foreach (Physics phy in _objects)
         {
             if (phy.IsLiving && phy != except)
             {
                 Rectangle t = phy.Bound;
                 Rectangle t1 = phy.Bound1;
                 t.Offset(phy.X, phy.Y);
                 t1.Offset(phy.X, phy.Y);
                 if (t.IntersectsWith(rect) || t1.IntersectsWith(rect))
                 {
                     list.Add(phy);
                 }
             }
         }
     }
     return list.ToArray();
 }
Ejemplo n.º 8
0
 public void RemovePhysical(Physics phy)
 {
     phy.SetMap(null);
     lock (_objects)
     {
         _objects.Remove(phy);
     }
 }
Ejemplo n.º 9
0
 protected override void CollideObjects(Physics[] list)
 {
     foreach (Physics phy in list)
     {
         phy.CollidedByObject(this);
         m_actions.Add(new BombAction(m_lifeTime, ActionType.PICK, phy.Id, 0, 0, 0));
     }
 }
Ejemplo n.º 10
0
 public FocusAction(Physics obj, int type, int delay, int finishTime)
     : base(delay, finishTime)
 {
     m_obj = obj;
     m_type = type;
 }
Ejemplo n.º 11
0
 public virtual void CollidedByObject(Physics phy) { }