protected override void OnAssignmentDone()
{
switch (m_state)
{
case State.MoveToItem:
Debug.Assert(this.Item.Location == this.Worker.Location);
m_state = State.CarryItem;
break;
case State.CarryItem:
Debug.Assert(this.Item.Container == this.Worker);
m_state = State.HaulToStockpile;
break;
case State.HaulToStockpile:
if (m_stockpile.Area.Contains(this.Worker.Location) && m_stockpile.LocationOk(this.Worker.Location, this.Item))
{
m_state = State.DropItem;
}
break;
case State.DropItem:
m_state = State.Done;
SetStatus(JobStatus.Done);
break;
default:
throw new Exception();
}
}