Esempio n. 1
0
        private void GoToPosition(object val)
        {
            MovementData data = val as MovementData;

            if (data == null)
            {
                throw new ArgumentException(nameof(data));
            }

            Logger.Trace(
                "[{tick}] Server controlled entity move {id} to '{position}'.",
                Room.Tick,
                Id,
                data);

            State.Movement.DefaultBehavior  = data.DefaultBehaviour;
            State.Movement.Position         = data.TargetPosition;
            State.Movement.TargetPartyIndex =
                data.TargetParty?.Party.Index ?? MovementState.InvalidPartyIndex;
        }
Esempio n. 2
0
        private void GoToPosition(object val)
        {
            MovementData data = val as MovementData;

            if (data == null)
            {
                throw new ArgumentException(nameof(data));
            }

            Logger.Trace("[{tick}] Request move entity {id} to '{position}'.", Room.Tick, Id, data);
            Room.RaiseEvent <EventPartyMoveTo>(
                e =>
            {
                e.EntityId = Id;
                e.Movement = new MovementState
                {
                    DefaultBehavior  = data.DefaultBehaviour,
                    Position         = data.TargetPosition,
                    TargetPartyIndex =
                        data.TargetParty?.Party.Index ?? MovementState.InvalidPartyIndex
                };
            });
        }