Exemplo n.º 1
0
        public override void Execute()
        {
            if (MoveTo == null)
            {
                Parent.Messages.Add(Resources.MSG_AI_INVALID_DESTINATION);
                Parent.PopState();
                return;
            }

            //// Arrived at my location
            if (MoveTo.Equals(Location))
            {
                Parent.Messages.Add(Resources.MSG_AI_ALREADY_AT_DESTINATION);
                Parent.PopState();
                return;
            }

            var exit = Location.Portals.Single(x => x.TargetSpace == MoveTo.SpaceDef);

            if (exit == null)
            {
                Parent.Messages.Add(Resources.MSG_AI_NO_PORTAL_TO_DESTINATION);
                Parent.PopState();
                return;
            }

            // TODO: Execute the move command
            //var moveCmd = CommandManager.Instance.GetCommand("playermove");
            //moveCmd.Execute(CommandManager.Instance.PopulateCommandArgs(Parent.Owner as IBiota, null, null, exit.Keywords));
        }