コード例 #1
0
ファイル: Monster.cs プロジェクト: TheaP/c-raft
        protected override List<World.Paths.PathCoordinate> GetNewPath()
        {
            var pathFinder = new World.Paths.PathFinder(this.World);
            var player = World.GetClosestPlayer(this.Position, 24.0) as Player;
            Target = player;
            if (Target != null)
            {
                var path = pathFinder.CreatePathToEntity(this, Target, SightRange);
                if (path != null)
                    Server.Logger.Log(LogLevel.Debug, "Found player within {0}, can reach in {1} blocks", SightRange, path.Count);

                return path;
            }

            return null;
        }
コード例 #2
0
        protected override List <World.Paths.PathCoordinate> GetNewPath()
        {
            var pathFinder = new World.Paths.PathFinder(this.World);
            var player     = World.GetClosestPlayer(this.Position, 24.0) as Player;

            Target = player;
            if (Target != null)
            {
                var path = pathFinder.CreatePathToEntity(this, Target, SightRange);
                if (path != null)
                {
                    Server.Logger.Log(LogLevel.Debug, "Found player within {0}, can reach in {1} blocks", SightRange, path.Count);
                }

                return(path);
            }

            return(null);
        }