public VBFactionManager() { if (instance != null) { Log.Fatal("RTSFactionManager: instance != null"); } instance = this; }
/// <summary>Overridden from <see cref="Engine.EntitySystem.Entity.OnPostCreate(Boolean)"/>.</summary> protected override void OnPostCreate(bool loaded) { if (instance == this) //for undo support { instance = this; } base.OnPostCreate(loaded); }
/// <summary>Overridden from <see cref="Engine.EntitySystem.Entity.OnDestroy()"/>.</summary> protected override void OnDestroy() { base.OnDestroy(); if (instance == this) //for undo support { instance = null; } }
/// <summary>Overridden from <see cref="Engine.EntitySystem.Entity.OnPostCreate2(bool)"/>.</summary> protected override void OnPostCreate2(bool loaded) { base.OnPostCreate2(loaded); GameWorld gameWorld = Parent as GameWorld; if (gameWorld != null) { gameWorld.DoActionsAfterMapCreated(); } UpdateWindSpeedSettings(); // VB: create player and VBFactionManager if (GameMap.Instance.GameType == GameMap.GameTypes.VanBuren && EntitySystemWorld.Instance.IsServer() || EntitySystemWorld.Instance.IsSingle()) { if (VBFactionManager.Instance == null) { VBFactionManager manager = (VBFactionManager)Entities.Instance.Create("VBFactionManager", this); manager.PostCreate(); } } }