Beispiel #1
0
 private void On(ForegroundPlaceEvent e)
 {
     this._lock.EnterReadLock();
     try
     {
         if (!this.InternalForeground.Remove(e.Old.Block, new Point(e.X, e.Y)))
         {
             return;                                                                    // Unknown block!
         }
         this.InternalForeground.Add(e.New.Block, new Point(e.X, e.Y));
     }
     finally
     {
         this._lock.ExitReadLock();
     }
 }
Beispiel #2
0
 private void On(ForegroundPlaceEvent e)
 {
     if (e.Old.Block.Id == Foreground.Coin.Gold)
     {
         foreach (var player in this)
         {
             player.RemoveGoldCoin(new Point(e.X, e.Y));
         }
     }
     else if (e.Old.Block.Id == Foreground.Coin.Blue)
     {
         foreach (var player in this)
         {
             player.RemoveBlueCoin(new Point(e.X, e.Y));
         }
     }
 }
Beispiel #3
0
 internal static bool AreSame(PlaceSendMessage sent, ForegroundPlaceEvent received)
 {
     return(sent.Id == (int)received.New.Block.Id &&
            sent.Args.SequenceEqual(received.New.Block.GetArgs()));
 }
Beispiel #4
0
 private void OnForeground(ForegroundPlaceEvent e)
 {
     this.Repair <ForegroundPlaceEvent, ForegroundBlock>(Layer.Foreground, e);
 }
Beispiel #5
0
 private void OnForegroundPlace(ForegroundPlaceEvent e)
 {
     if (e.New.Block.Type == ForegroundType.Team)
     {
         CreatePlayground(new Point(e.X, e.Y), e.New.Block.Text);
     }
 }