Esempio n. 1
0
        public void StartAction(GameAction action, ActionPriority priority)
        {
            D("DoAction: {0}", action);

            Debug.Assert(!this.HasAction);
            Debug.Assert(priority != ActionPriority.Undefined);
            Debug.Assert(action.GUID.IsNull == false);

            this.CurrentAction    = action;
            this.ActionPriority   = priority;
            this.ActionTotalTicks = 0;
            this.ActionTicksUsed  = 0;

            var e = new ActionStartEvent()
            {
                Action   = action,
                Priority = priority,
            };

            if (m_ai != null)
            {
                m_ai.ActionStarted(e);
            }

            var c = new ActionStartedChange(this)
            {
                ActionStartEvent = e,
            };

            this.World.AddChange(c);
        }
Esempio n. 2
0
        public void StartAction(GameAction action, ActionPriority priority, int userID)
        {
            D("DoAction: {0}, uid: {1}", action, userID);

            Debug.Assert(!this.HasAction);
            Debug.Assert(priority != ActionPriority.Undefined);
            Debug.Assert(action.MagicNumber != 0);

            this.CurrentAction = action;
            this.ActionPriority = priority;
            this.ActionTotalTicks = 0;
            this.ActionTicksUsed = 0;
            this.ActionUserID = userID;

            var e = new ActionStartEvent()
            {
                Action = action,
                Priority = priority,
                UserID = userID,
            };

            if (m_ai != null)
                m_ai.ActionStarted(e);

            var c = new ActionStartedChange(this)
            {
                ActionStartEvent = e,
            };

            this.World.AddChange(c);
        }
Esempio n. 3
0
        public void StartAction(GameAction action, ActionPriority priority)
        {
            D("DoAction: {0}", action);

            Debug.Assert(!this.HasAction);
            Debug.Assert(priority != ActionPriority.Undefined);
            Debug.Assert(action.GUID.IsNull == false);

            this.CurrentAction = action;
            this.ActionPriority = priority;
            this.ActionTotalTicks = 0;
            this.ActionTicksUsed = 0;

            var e = new ActionStartEvent()
            {
                Action = action,
                Priority = priority,
            };

            if (m_ai != null)
                m_ai.ActionStarted(e);

            var c = new ActionStartedChange(this)
            {
                ActionStartEvent = e,
            };

            this.World.AddChange(c);
        }