public void CollectObject()
    {
        // make sure the player has selected an object that we can collect
        if (playerManager.SelectedServerObject == null)
        {
            return;
        }

        // move to the object
        // then collect it :)

        Protocol.MovePlayer movePlayer = new Protocol.MovePlayer()
        {
            Position = playerManager.HitLocation.location
        };

        playerManager.QueueAction(movePlayer);


        Protocol.CollectItem collectObject = new Protocol.CollectItem()
        {
            object_id = playerManager.SelectedServerObject.serverObjectId
        };

        playerManager.QueueAction(collectObject);
    }
Exemple #2
0
    public void MovePlayer()
    {
        Protocol.MovePlayer movePlayer = new Protocol.MovePlayer()
        {
            Position = playerManager.HitLocation.location
        };

        playerManager.QueueAction(movePlayer);
    }
Exemple #3
0
    public void MovePlayer(Protocol.BaseProtocol proto)
    {
        Protocol.MovePlayer movePlayer = proto.AsType <Protocol.MovePlayer>();

        if (movePlayer.player_id == playerId)
        {
            clientAgent.MoveAgent(movePlayer.Position);
            currentAction = clientAgent;
        }
    }
    public void MoveToAndDropObject()
    {
        if (playerManager.SelectedServerObject != null)
        {
            return;
        }

        Protocol.MovePlayer movePlayer = new Protocol.MovePlayer()
        {
            Position = playerManager.HitLocation.location
        };

        playerManager.QueueAction(movePlayer);


        Protocol.GameAction gameAct = new Protocol.GameAction(Protocol.GameAction.Actions.DropItem);

        playerManager.QueueAction(gameAct);
    }
Exemple #5
0
    public void Build()
    {
        // move to the location.

        Protocol.MovePlayer movePlayer = new Protocol.MovePlayer()
        {
            Position = playerManager.HitLocation.location
        };

        playerManager.QueueAction(movePlayer);

        // que build object.

        Protocol.BuildObject buildObj = new Protocol.BuildObject()
        {
            Type = Protocol.ServerObject.ObjectType.Block
        };

        playerManager.QueueAction(buildObj);
    }