/// <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() }); } }
public void ClearHoles() { if (Holes == null) { return; } Holes.Clear(); }
public void ClearHoles() { Holes.Clear(); }