Ejemplo n.º 1
0
        /// <summary>
        /// Load the course info from the current map.
        /// </summary>
        public void LoadFromMap()
        {
            Host.AssertServer();

            Holes.Clear();
            foreach (var hole in Entity.All.OfType <HoleSpawn>())
            {
                var goal = Entity.All.OfType <HoleGoal>().Where(x => x.Hole == hole.Number).First();

                if (goal == null)
                {
                    Log.Error($"No ball goal found for [Hole {hole.Number}]");
                    continue;
                }

                Log.Info($"Hole ({hole.Number}) - {hole.Name}");

                // todo: sort this list

                Holes.Add(new HoleInfo()
                {
                    Number = hole.Number,
                    // Name = hole.Name,
                    Par           = hole.Par,
                    SpawnPosition = hole.Position,
                    SpawnAngles   = hole.WorldAng,
                    // GoalPosition = goal.Position,
                    // Bounds = Entity.All.OfType<HoleBounds>().Where(x => x.Hole == hole.Number).ToList()
                });
            }
        }
Ejemplo n.º 2
0
 public void ClearHoles()
 {
     if (Holes == null)
     {
         return;
     }
     Holes.Clear();
 }
Ejemplo n.º 3
0
 public void ClearHoles()
 {
     Holes.Clear();
 }