Beispiel #1
0
        public ActorAgent(IActorRef actorTextOutput, Agent ag, IActorRef actorSolarSystem)
        {
            _actorTextOutput  = actorTextOutput;
            _actorSolarSystem = actorSolarSystem;
            _agent            = ag;
            _tickCompleteCmd  = new MessageEngineAgCompletedCommand(_agent.AgentId);

            AgentControllerState stateForAgent = new AgentControllerState(ag);

            switch (_agent.Type)
            {
            //case AgentTypeEnum.Trader:
            //    _agentC = new AgentTraderController(ag, _actorTextOutput);
            //    break;
            default:
                _agentC = new AgentDefaultController(stateForAgent, _actorSolarSystem, _actorTextOutput);
                break;
            }

            Receive <MessageTick>(msg => receiveDefaultTick(msg));
        }
Beispiel #2
0
        public ActorAgent(IActorRef actorTextOutput, Agent ag, IActorRef actorSolarSystem)
        {
            _actorTextOutput = actorTextOutput;
            _actorSolarSystem = actorSolarSystem;
            _agent = ag;
            _tickCompleteCmd = new MessageEngineAgCompletedCommand(_agent.AgentId);

            AgentControllerState stateForAgent = new AgentControllerState(ag);

            switch(_agent.Type)
            {
                //case AgentTypeEnum.Trader:
                //    _agentC = new AgentTraderController(ag, _actorTextOutput);
                //    break;
                default:
                    _agentC = new AgentDefaultController(stateForAgent, _actorTextOutput);
                    break;
            }

            Receive<MessageTick>(msg => receiveDefaultTick(msg));
            Receive<MessageShipResponse>(msg => receiveShipResponse(msg));
            Receive<MessageAgentDestinationReached>(msg => receiveShipDestinationReached(msg));
        }