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)); }
public void ReplaceBlock(BoardSlot boardSlot, Block block) { boardSlot.PutBlock(block); OnBoardSlotChanged(BoardSlotChangedEventArgs.FromBoardSlot(boardSlot, BoardSlotChangeOrigin.MergedInto)); }
public void SpawnBlock(Point point, Block block) { Slots[point].PutBlock(block); OnBoardSlotChanged(BoardSlotChangedEventArgs.FromBoardSlot(Slots[point], BoardSlotChangeOrigin.Spawned)); }
protected virtual void OnBoardSlotChanged(BoardSlotChangedEventArgs e) { EventHandler <BoardSlotChangedEventArgs> handler = BoardSlotChanged; handler?.Invoke(this, e); }
public void RemoveBlock(BoardSlot slot) { slot.RemoveBlock(); OnBoardSlotChanged(BoardSlotChangedEventArgs.FromBoardSlot(slot, BoardSlotChangeOrigin.MergedFrom)); }