Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/gamesettings/attributes/Seeds.js
- This file was added.
GameSettings.prototype.Attributes.Seeds = class extends GameSetting | |||||
{ | |||||
Init() | |||||
{ | |||||
this.seed = 0; | |||||
this.AIseed = 0; | |||||
} | |||||
LegacySerialize(attribs) | |||||
{ | |||||
// Seed is used for map generation and simulation. | |||||
attribs.settings.Seed = this.seed; | |||||
attribs.settings.AISeed = this.AIseed; | |||||
} | |||||
LegacyDeserialize(attribs) | |||||
{ | |||||
// Seed is used for map generation and simulation. | |||||
if (this.getLegacySetting(attribs, "Seed") !== undefined) | |||||
this.seed = this.getLegacySetting(attribs, "Seed"); | |||||
if (this.getLegacySetting(attribs, "AISeed") !== undefined) | |||||
this.AIseed = this.getLegacySetting(attribs, "AISeed"); | |||||
} | |||||
pickRandomItems() | |||||
{ | |||||
this.seed = randIntExclusive(0, Math.pow(2, 32)); | |||||
this.AIseed = randIntExclusive(0, Math.pow(2, 32)); | |||||
} | |||||
}; |
Wildfire Games · Phabricator