public void SetMovable(MovableBase boxOrPorter) { _boxOrPorter = boxOrPorter; _hasBoxOrPorter = true; if (boxOrPorter is Box) { _hasBox = true; } else { _hasBox = false; } }
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; } }
public void ClearMovable() { _boxOrPorter = null; _hasBoxOrPorter = false; _hasBox = false; }