You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
621 B
21 lines
621 B
using Godot;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using Babushka.scripts.CSharp.Common.WorldManagement;
|
|
|
|
public partial class World : Node
|
|
{
|
|
public IReadOnlyDictionary<SpawnPointResource, SpawnPointMarker> SpawnPoints;
|
|
|
|
public override void _EnterTree()
|
|
{
|
|
GD.Print("World Enter Tree");
|
|
|
|
// find all child nodes of type SpawnPoint
|
|
SpawnPoints = FindChildren("*")
|
|
.OfType<SpawnPointMarker>()
|
|
.Select(sp => new KeyValuePair<SpawnPointResource, SpawnPointMarker>(sp.spawnPointResource, sp))
|
|
.ToDictionary();
|
|
}
|
|
} |