Esempio n. 1
0
        private PackBase HandleWalkAction(SingleWalkAction walkAction)
        {
            if (walkAction == null)
            {
                return(null);
            }

            CreatureMovePack movePack = new CreatureMovePack(walkAction.CreatureId, walkAction.MovePath);

            FDCreature creature = GetCreature(walkAction.CreatureId);

            if (creature == null)
            {
                return(null);
            }

            if (walkAction.MovePath?.Desitination != null)
            {
                creature.SetMoveTo(walkAction.MovePath.Desitination);
            }

            if (walkAction.DelayUnits > 0)
            {
                IdlePack idle = IdlePack.FromTimeUnit(walkAction.DelayUnits);
                return(new SequencedPack(idle, movePack));
            }

            return(movePack);
        }
Esempio n. 2
0
        public void CreatureWalk(SingleWalkAction walkAction)
        {
            var movePack = HandleWalkAction(walkAction);

            gameCallback.OnHandlePack(movePack);
        }