public void CreatePorter(int i, int j) { if (_thePorter != null) { this[_thePorter.Position].ClearMovable(); } _thePorter = new Porter(this, i, j); this[i, j].SetMovable(_thePorter); }
public void ClearMovable(int i, int j) { if (!this[i, j].HasBoxOrPorter) { return; } MovableBase boxOrPorter = this[i, j].BoxOrPorter; this[i, j].ClearMovable(); if (boxOrPorter is Box) { Boxes.Remove(boxOrPorter as Box); } else { _thePorter = null; } }