예제 #1
0
            public override bool NextTick(GameManager gameManager)
            {
                var p    = _Act_Path[_Act_PathIndex];
                var oldP = _Act_Path[_Act_PathIndex == 0 ? 0 : _Act_PathIndex - 1];

                p.Faction = _Act_Entity.FactionId;

                _Act_Entity.Direction = HexUtils.GetDirection(oldP, p);
                _Act_Entity.X         = p.X;
                _Act_Entity.Z         = p.Z;

                foreach (var neighbor in p.GetNeighbors())
                {
                    var hex = gameManager.GameBoard.GetHexagon(neighbor.X, neighbor.Z);
                    if (hex != null)
                    {
                        hex.Faction = _Act_Entity.FactionId;
                    }
                }
                _Act_PathIndex++;
                if (_Act_Path.Count == _Act_PathIndex)
                {
                    return(false);
                }
                return(true);
            }