コード例 #1
0
        public void MoveBlock(BoardSlot from, BoardSlot to)
        {
            to.PutBlock(from.GetBlock());
            from.PutBlock(null);

            OnBoardSlotChanged(BoardSlotChangedEventArgs.FromBoardSlot(from, BoardSlotChangeOrigin.Moved));
            OnBoardSlotChanged(BoardSlotChangedEventArgs.FromBoardSlot(to, BoardSlotChangeOrigin.Moved));
        }
コード例 #2
0
 public void ReplaceBlock(BoardSlot boardSlot, Block block)
 {
     boardSlot.PutBlock(block);
     OnBoardSlotChanged(BoardSlotChangedEventArgs.FromBoardSlot(boardSlot, BoardSlotChangeOrigin.MergedInto));
 }
コード例 #3
0
 public void SpawnBlock(Point point, Block block)
 {
     Slots[point].PutBlock(block);
     OnBoardSlotChanged(BoardSlotChangedEventArgs.FromBoardSlot(Slots[point], BoardSlotChangeOrigin.Spawned));
 }
コード例 #4
0
        protected virtual void OnBoardSlotChanged(BoardSlotChangedEventArgs e)
        {
            EventHandler <BoardSlotChangedEventArgs> handler = BoardSlotChanged;

            handler?.Invoke(this, e);
        }
コード例 #5
0
 public void RemoveBlock(BoardSlot slot)
 {
     slot.RemoveBlock();
     OnBoardSlotChanged(BoardSlotChangedEventArgs.FromBoardSlot(slot, BoardSlotChangeOrigin.MergedFrom));
 }