Exemple #1
0
 public override void CollidedByObject(Physics phy)
 {
     if (m_canPenetrate == false && phy is SimpleBomb)
     {
         ((SimpleBomb)phy).Bomb();
     }
 }
Exemple #2
0
 public override void CollidedByObject(Physics phy)
 {
     if (phy is SimpleBomb)
     {
         SimpleBomb bomb = phy as SimpleBomb;
         bomb.Owner.PickBox(this);
     }
 }
Exemple #3
0
 public void AddPhysical(Physics phy)
 {
     phy.SetMap(this);
     lock (_objects)
     {
         _objects.Add(phy);
     }
 }
Exemple #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);
 }
Exemple #5
0
 protected virtual void CollideObjects(Physics[] list)
 {
 }
Exemple #6
0
 public override void CollidedByObject(Physics phy)
 {
     if (phy is SimpleBomb)
     {
         ((SimpleBomb)phy).Bomb();
     }
 }
Exemple #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();
 }
Exemple #8
0
 public void RemovePhysical(Physics phy)
 {
     phy.SetMap(null);
     lock (_objects)
     {
         _objects.Remove(phy);
     }
 }
Exemple #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));
     }
 }
Exemple #10
0
 public FocusAction(Physics obj, int type, int delay, int finishTime)
     : base(delay, finishTime)
 {
     m_obj = obj;
     m_type = type;
 }
Exemple #11
0
 public virtual void CollidedByObject(Physics phy) { }