public PlanetData(PlanetTypeEnum type) { switch (type) { case PlanetTypeEnum.Desert: data = new PlanetTypeEgypt(); break; case PlanetTypeEnum.Forest: data = new PlanetTypeForest(); break; case PlanetTypeEnum.Water: data = new PlanetTypeHawaii(); break; case PlanetTypeEnum.Icy: data = new PlanetTypeIce(); break; case PlanetTypeEnum.Plain: data = new PlanetTypeIceGrey(); break; case PlanetTypeEnum.Clay: data = new PlanetTypeOrange(); break; case PlanetTypeEnum.Tundra: data = new PlanetTypePine(); break; } }
public void PlanetLanding(PlanetTypeEnum type, string planetName, Vector3 enterCoordinates, Quaternion enterRotation) { this.currentPlanet = planetName; this.enterCoordinates = enterCoordinates; this.enterRotation = enterRotation; this.currentPlanetType = type; }
public PlanetInformation(bool forceNotInhabited) { PlanetType = (PlanetTypeEnum)Random.Range(0, forceNotInhabited ? 2 : 3); ResourcesRich = PlanetType == PlanetTypeEnum.Inhabited ? 0 : Random.Range(1, 4); Variant = Random.Range(0, 100); if (NameManager.Instance != null) { Name = NameManager.Instance.GetPlanetName(); } Inhabited = (PlanetType == PlanetTypeEnum.Inhabited); }
/// <summary> /// Initializes a new instance of the <see cref="GetCharactersCharacterIdPlanets200Ok" /> class. /// </summary> /// <param name="LastUpdate">last_update string (required).</param> /// <param name="NumPins">num_pins integer (required).</param> /// <param name="OwnerId">owner_id integer (required).</param> /// <param name="PlanetId">planet_id integer (required).</param> /// <param name="PlanetType">planet_type string (required).</param> /// <param name="SolarSystemId">solar_system_id integer (required).</param> /// <param name="UpgradeLevel">upgrade_level integer (required).</param> public GetCharactersCharacterIdPlanets200Ok(DateTime?LastUpdate = default(DateTime?), int?NumPins = default(int?), int?OwnerId = default(int?), int?PlanetId = default(int?), PlanetTypeEnum PlanetType = default(PlanetTypeEnum), int?SolarSystemId = default(int?), int?UpgradeLevel = default(int?)) { // to ensure "LastUpdate" is required (not null) if (LastUpdate == null) { throw new InvalidDataException("LastUpdate is a required property for GetCharactersCharacterIdPlanets200Ok and cannot be null"); } else { this.LastUpdate = LastUpdate; } // to ensure "NumPins" is required (not null) if (NumPins == null) { throw new InvalidDataException("NumPins is a required property for GetCharactersCharacterIdPlanets200Ok and cannot be null"); } else { this.NumPins = NumPins; } // to ensure "OwnerId" is required (not null) if (OwnerId == null) { throw new InvalidDataException("OwnerId is a required property for GetCharactersCharacterIdPlanets200Ok and cannot be null"); } else { this.OwnerId = OwnerId; } // to ensure "PlanetId" is required (not null) if (PlanetId == null) { throw new InvalidDataException("PlanetId is a required property for GetCharactersCharacterIdPlanets200Ok and cannot be null"); } else { this.PlanetId = PlanetId; } // to ensure "PlanetType" is required (not null) if (PlanetType == null) { throw new InvalidDataException("PlanetType is a required property for GetCharactersCharacterIdPlanets200Ok and cannot be null"); } else { this.PlanetType = PlanetType; } // to ensure "SolarSystemId" is required (not null) if (SolarSystemId == null) { throw new InvalidDataException("SolarSystemId is a required property for GetCharactersCharacterIdPlanets200Ok and cannot be null"); } else { this.SolarSystemId = SolarSystemId; } // to ensure "UpgradeLevel" is required (not null) if (UpgradeLevel == null) { throw new InvalidDataException("UpgradeLevel is a required property for GetCharactersCharacterIdPlanets200Ok and cannot be null"); } else { this.UpgradeLevel = UpgradeLevel; } }
/// <summary> /// Initializes a new instance of the <see cref="GetCharactersCharacterIdPlanets200Ok" /> class. /// </summary> /// <param name="lastUpdate">last_update string (required).</param> /// <param name="numPins">num_pins integer (required).</param> /// <param name="ownerId">owner_id integer (required).</param> /// <param name="planetId">planet_id integer (required).</param> /// <param name="planetType">planet_type string (required).</param> /// <param name="solarSystemId">solar_system_id integer (required).</param> /// <param name="upgradeLevel">upgrade_level integer (required).</param> public GetCharactersCharacterIdPlanets200Ok(DateTime?lastUpdate = default(DateTime?), int?numPins = default(int?), int?ownerId = default(int?), int?planetId = default(int?), PlanetTypeEnum planetType = default(PlanetTypeEnum), int?solarSystemId = default(int?), int?upgradeLevel = default(int?)) { // to ensure "lastUpdate" is required (not null) if (lastUpdate == null) { throw new InvalidDataException("lastUpdate is a required property for GetCharactersCharacterIdPlanets200Ok and cannot be null"); } else { this.LastUpdate = lastUpdate; } // to ensure "numPins" is required (not null) if (numPins == null) { throw new InvalidDataException("numPins is a required property for GetCharactersCharacterIdPlanets200Ok and cannot be null"); } else { this.NumPins = numPins; } // to ensure "ownerId" is required (not null) if (ownerId == null) { throw new InvalidDataException("ownerId is a required property for GetCharactersCharacterIdPlanets200Ok and cannot be null"); } else { this.OwnerId = ownerId; } // to ensure "planetId" is required (not null) if (planetId == null) { throw new InvalidDataException("planetId is a required property for GetCharactersCharacterIdPlanets200Ok and cannot be null"); } else { this.PlanetId = planetId; } // to ensure "planetType" is required (not null) if (planetType == null) { throw new InvalidDataException("planetType is a required property for GetCharactersCharacterIdPlanets200Ok and cannot be null"); } else { this.PlanetType = planetType; } // to ensure "solarSystemId" is required (not null) if (solarSystemId == null) { throw new InvalidDataException("solarSystemId is a required property for GetCharactersCharacterIdPlanets200Ok and cannot be null"); } else { this.SolarSystemId = solarSystemId; } // to ensure "upgradeLevel" is required (not null) if (upgradeLevel == null) { throw new InvalidDataException("upgradeLevel is a required property for GetCharactersCharacterIdPlanets200Ok and cannot be null"); } else { this.UpgradeLevel = upgradeLevel; } }