protected StaticFeatureResolver(WorldType worldType, Key key, int idOffset) { IdOffset = idOffset; Key = key; WorldType = worldType; key.Flavour = key.Flavour ?? new KeyFlavour(this); KeyFlavour = key.Flavour; FeatureKeyFlavour = new KeyFlavour(this); }
public CivilizationRegister(Key key, short max, WorldType worldTypeBase, WorldType worldTypeCiv, byte worldTypePlayerId = 255) { Key = key; key.Flavour = key.Flavour ?? new KeyFlavour(this); KeyFlavour = key.Flavour; FeatureKeyFlavour = new KeyFlavour(this); Max = (short)(Math.Pow(2, Math.Ceiling(Math.Log(max, 2))) - 1); //this is one lower because 0 -> not owned _civilizations = new List <Civilization>(Math.Min((short)128, Max)); Resolver = new CivilizationFeatureResolver(this, worldTypeBase, worldTypeCiv, worldTypePlayerId); //set all Dis Resolver.PopulateDataIdentifiers(); }