Exemplo n.º 1
0
        protected override IAssignment PrepareNextAssignment()
        {
            IAssignment assignment;

            switch (m_state)
            {
            case State.MoveToItem:
                assignment = new MoveAssignment(this, this.Item.Environment, this.Item.Location, DirectionSet.Exact);
                break;

            case State.CarryItem:
                assignment = new CarryItemAssignment(this, this.Item);
                break;

            case State.Haul:
                assignment = new HaulAssignment(this, m_environment, m_location, m_positioning, this.Item);
                break;

            case State.DropItem:
                assignment = new DropItemAssignment(this, this.Item);
                break;

            default:
                throw new Exception();
            }

            return(assignment);
        }
Exemplo n.º 2
0
        protected override IAssignment PrepareNextAssignment()
        {
            IAssignment assignment;

            switch (m_state)
            {
            case State.MoveToItem:
                assignment = new MoveAssignment(this, this.Item.Environment, this.Item.Location, DirectionSet.Exact);
                break;

            case State.CarryItem:
                assignment = new CarryItemAssignment(this, this.Item);
                break;

            case State.HaulToStockpile:
                if (!m_stockpile.Area.Contains(this.Worker.Location))
                {
                    assignment = new HaulToAreaAssignment(this, m_stockpile.Environment, m_stockpile.Area.ToIntGrid3(), DirectionSet.Exact, this.Item);
                }
                else
                {
                    bool ok;
                    var  l = m_stockpile.FindEmptyLocation(out ok);
                    if (!ok)
                    {
                        throw new Exception();
                    }

                    assignment = new HaulAssignment(this, m_stockpile.Environment, l, DirectionSet.Exact, this.Item);
                }
                break;

            case State.DropItem:
                assignment = new DropItemAssignment(this, this.Item);
                break;

            default:
                throw new Exception();
            }

            return(assignment);
        }
Exemplo n.º 3
0
        protected override IAssignment PrepareNextAssignment()
        {
            IAssignment assignment;

            switch (m_state)
            {
            case 0:
                assignment = new MoveAssignment(this, m_item.Environment, m_item.Location, DirectionSet.Exact);
                break;

            case 1:
                assignment = new InstallItemAssignment(this, m_item, m_mode);
                break;

            default:
                throw new Exception();
            }

            return(assignment);
        }
Exemplo n.º 4
0
        protected override IAssignment PrepareNextAssignment()
        {
            IAssignment assignment;

            switch (m_state)
            {
            case 0:
                assignment = new MoveAssignment(this, this.Bed.Environment, this.Bed.Location, DirectionSet.Exact);
                break;

            case 1:
                assignment = new SleepAssignment(this, this.Bed);
                break;

            default:
                throw new Exception();
            }

            return(assignment);
        }
Exemplo n.º 5
0
        protected override IAssignment PrepareNextAssignment()
        {
            IAssignment assignment;

            switch (m_state)
            {
            case 0:
                var positioning = GetPositioning();
                assignment = new MoveAssignment(this, this.Environment, this.Location, positioning);
                break;

            case 1:
                assignment = CreateAssignment();
                break;

            default:
                throw new Exception();
            }

            return(assignment);
        }
Exemplo n.º 6
0
        protected override IAssignment PrepareNextAssignment()
        {
            IAssignment assignment;

            switch (m_state)
            {
            case 0:
                assignment = new MoveAssignment(this, this.Item.Environment, this.Item.Location, DirectionSet.Exact);
                break;

            case 1:
                assignment = new GetItemAssignment(this, this.Item);
                break;

            case 2:
                assignment = new ConsumeItemAssignment(this, this.Item);
                break;

            default:
                throw new Exception();
            }

            return(assignment);
        }