예제 #1
0
 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);
 }
예제 #2
0
        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;
            }
        }