|
|
|
using System.Globalization;
|
|
|
|
|
|
|
|
public partial class Game : Node
|
|
|
|
{
|
|
|
|
public static Game Instance { get; private set; }
|
|
|
|
public static new MultiplayerManager Multiplayer { get; private set; }
|
|
|
|
|
|
|
|
public static Players Players { get; private set; }
|
|
|
|
public static Player LocalPlayer { get; private set; }
|
|
|
|
|
|
|
|
public static Workshops Workshops { get; private set; }
|
|
|
|
public static Workshop LocalWorkshop { get; private set; }
|
|
|
|
|
|
|
|
public override void _EnterTree()
|
|
|
|
{
|
|
|
|
// Set invariant culture so formatting is consistent.
|
|
|
|
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
|
|
|
|
|
|
|
|
Instance = this;
|
|
|
|
Multiplayer = this.GetNodeOrThrow<MultiplayerManager>(nameof(MultiplayerManager));
|
|
|
|
|
|
|
|
Players = this.GetNodeOrThrow<Players>(nameof(Players));
|
|
|
|
LocalPlayer = Players.Single();
|
|
|
|
|
|
|
|
Workshops = this.GetNodeOrThrow<Workshops>(nameof(Workshops));
|
|
|
|
LocalWorkshop = Workshops.Single();
|
|
|
|
}
|
|
|
|
}
|