private void assertFeatureWorld(FeatureWorld other) { if (!World.FeatureWorld.Equals(other)) { throw new ArgumentException( "FeatureWorld not matching! This is a serious exception. This should never ever happen as FeatureWorld describes the features of a world. Setting different features will lead to undefined behavior"); } }
public void Freeze(FeatureWorld fw) { FeatureWorld = fw; foreach (var manager in _managers) { manager.Freeze(); } IsFrozen = true; }
private void LockFeatureWorld() { //init FeatureWorld = new FeatureWorld(2, YieldManager); FeatureWorld.Register(WFeatureBiome); FeatureWorld.Register(WFeatureVegetation); FeatureWorld.Register(WFeatureLandform); FeatureWorld.Register(CivilizationManager.Resolver); FeatureWorld.Lock(); }
public void Freeze(FeatureWorld fw) { if (IsFrozen) { throw new FeatureResolverLockedException("Feature already locked."); } FeatureWorld = fw; Features.TrimExcess(); OnFreeze(); GlobalResourceManager.Instance.FreezeResourceable(this); //so that hooks on this get resolved IsFrozen = true; }
public TileWorld(FeatureWorld features, int height, int width, IWorldHolder holder, WorldMode mode, CivilizationManager civilizationManager, bool wrapVertical, bool wrapHorizontal) { Height = height; Width = width; FeatureWorld = features; WorldType = holder.WorldType; Holder = holder; Mode = mode; CivilizationManager = civilizationManager; WrapVertical = wrapVertical; WrapHorizontal = wrapHorizontal; _worldData = new BitVector32[height, width, features.GetTileSize(WorldType)]; }
public static IView CreateView(IConsole console) { var root = new RootKey("root"); YieldManager ym = new YieldManagerImpl(new Key(root, "yield")); var fw = new FeatureWorld(1, ym); fw.Lock(); var world = new TileWorld(fw, 50, 50, WorldMode.Master); var view = new WorldView(console, world); view.Renderers.Add(new TestCRenderer()); return(view); }
public void Freeze(FeatureWorld fw) { FeatureWorld = fw; }
public void Freeze(FeatureWorld fw) { Register.Freeze(); FeatureWorld = fw; }