Пример #1
0
        public void InteractWith(Actors.Actor actor)
        {
            if (!PlayerSpotted && actor.HasTrait(Trait.Player))
            {
                MainGraphicDisplay.TextConsole.AddOutputText("There is nothing there to make use of");
                return;
            }

            if (_interactionFunction == null && _interactionTrap == null)
            {
                if (actor.HasTrait(Trait.Player))
                {
                    MainGraphicDisplay.TextConsole.AddOutputText("You can't do anything with that");
                }
                else
                {
                    // TODO: Add error text here
                }
                return;
            }

            if (_interactionTrap != null)
            {
                interactionFunctions[_interactionTrap](this, actor);
            }
            if (_interactionFunction != null)
            {
                interactionFunctions[_interactionFunction](this, actor);
            }
        }
Пример #2
0
        public override void OnOperationRequest(OperationRequest operationRequest, SendParameters sendParameters, ServerPeer peer)
        {
            Actors.Actor actor = ServerApp.instance.actorManager.GetActorFromGuid(peer.peerGuid);
            CellRoom     room  = ServerApp.instance.cellManager.TryGetRoomByIndex(actor.roomIndex);

            room.AddFinishCounter();
        }
Пример #3
0
        public void Awake()
        {
            this.actor = this.GetComponent <Actors.Actor>();

            //OverworldEventManager.Instance().onAdvanceTurn += Disable;
            //OverworldEventManager.Instance().onResolveTurn += Enable;
        }
Пример #4
0
        public bool MoveOff(Actors.Actor actor, int destinationX, int destinationY)
        {
            if (_moveOffFunction == null)
            {
                return(true);
            }

            // TODO: Implement move function here
            return(true);
        }
Пример #5
0
        public bool MoveOn(Actors.Actor actor, int originX, int originY)
        {
            if (_moveOnFunction == null)
            {
                return(true);
            }

            // TODO: Implement move function here.
            return(true);
        }
Пример #6
0
        public override void OnOperationRequest(OperationRequest operationRequest, SendParameters sendParameters, ServerPeer peer)
        {
            // Create response.
            OperationResponse response = new OperationResponse(operationRequest.OperationCode);

            // Try to create room.
            Actors.Actor actor = ServerApp.instance.actorManager.GetActorFromGuid(peer.peerGuid);
            CellRoom     room  = ServerApp.instance.cellManager.CreateRoom(actor.memberID);

            if (room == null)
            {
                response.ReturnCode   = (short)ResultCode.Failed;
                response.DebugMessage = "CreateRoom failed.";
            }
            else
            {
                ServerApp.Logger.InfoFormat("Acotr {0} create room index: {1}", actor.memberID, room.SerialNum);

                response.ReturnCode   = (short)ResultCode.Success;
                response.DebugMessage = "CreateRoom Success.";
            }

            peer.SendOperationResponse(response, sendParameters);
        }
Пример #7
0
 public ActorViewModel(Actors.Actor actor)
 {
     _actor = actor.ThrowIfNull(nameof(actor));
 }
 public ActorViewModel(Actors.Actor actor)
 {
     _actor = actor;
 }