public Blueprint(string name, int id, string desc, BlueprintType type, int value, List <Item> itemsToConsume) { blueprintName = name; blueprintID = id; blueprintDesc = desc; blueprintType = type; ItemsToConsume = new List <Item>(itemsToConsume); for (int i = 0; i < itemsToConsume.Count; i++) { ItemsToConsume [i] = itemsToConsume [i]; } switch (type) { case BlueprintType.Consumable: blueprintIcon = Resources.Load <Sprite> ("Items/consumables/" + name); break; case BlueprintType.Structure: blueprintIcon = Resources.Load <Sprite>("Items/structures/" + name); break; case BlueprintType.Material: blueprintIcon = Resources.Load <Sprite>("Items/materials/" + name); break; } }
public static Blueprint GetBlueprint(BlueprintType b, string name) { foreach (Blueprint bp in blueprints[b]) { if (bp.name == name) { return bp; } } Debug.LogWarning ("Blueprint " + name + " not found."); return null; }
public BlueprintTypeTabContent CreateTab(BlueprintType blueprintType) { var tab = Instantiate(tabPrefab, transform) .GetComponent <BlueprintTypeTabContent>(); tab.SetType(blueprintType); tabsByType.Add(blueprintType, tab); tab.gameObject.SetActive(false); return(tab); }
private List <IndexedBlueprint> GetSafe(MyDefinitionId id, BlueprintType type) { var itype = (int)type; List <IndexedBlueprint> vals; if (!m_index[itype].TryGetValue(id, out vals)) { m_index[itype][id] = vals = new List <IndexedBlueprint>(); } return(vals); }
public void Init(BlueprintType blueprintType, BlueprintTypeTabContent content, int order, NavigateableTabManager tabManager) { this.content = content; this.order = order; text.text = blueprintType.displayName; button.onClick.AddListener(() => { SelectType?.Invoke(blueprintType); tabManager.SwitchTo(this); }); }
private void LoadBlueprints() { blueprintTypes = new List <BlueprintType>(); List <BlueprintType> tList = BlueprintType.GetList(); foreach (var bp in tList) { if (bp.ProductionPoints > 0) { blueprintTypes.Add(bp); } } }
public ResourceInCycle(BattleSceneTypeResource res, int cycleNumber) { rnd = new Random(); probability = 0; amount = 0; resType = res.ResourceType; bpType = res.BlueprintType; anyEnemy = res.AnyEnemy == 1; //Пока что гарантированный дроп падает в тот цикл, который минимален для данного ресурса if (res.GuaranteedAmount > 0) { if (res.MinimumCycle == cycleNumber) { guaranteedAmount = res.GuaranteedAmount; } } if (res.AnyEnemy == 0) { EnemyId = res.EnemyId; } else { EnemyId = 0; } if (guaranteedAmount > 0) { enemies = new List <StageEnemy>(); } //Это дроп ресурса, который падает с определенной вероятностью if (cycleNumber >= res.MinimumCycle && res.AmountFrom > 0 && res.VariableChanceFrom > 0) { this.resType = res.ResourceType; this.bpType = res.BlueprintType; if (res.MaximumCycle <= cycleNumber) { probability = res.VariableChanceTo / 10000; amount = res.AmountTo; } else { probability = (double)res.VariableChanceFrom / 10000 + (double)(cycleNumber - res.MinimumCycle) / (double)(res.MaximumCycle - res.MinimumCycle) * (double)((res.VariableChanceTo - res.VariableChanceFrom) / 1000); amount = (double)res.AmountFrom + (double)(cycleNumber - res.MinimumCycle) / (double)(res.MaximumCycle - res.MinimumCycle) * (double)(res.AmountTo - res.AmountFrom); } } }
public override string ToString() { if (ResourceType == null && BlueprintType == null) { return("new resource drop"); } else if (this.BlueprintType != null) { return(BlueprintType.ToString()); } else { return(ResourceType.Name); } }
/// <summary> /// Constructor from the API. /// </summary> /// <param name="src"></param> internal IndustryJob(SerializableJobListItem src) { m_state = GetState(src); m_jobID = src.JobID; m_installedItemID = src.InstalledItemTypeID; m_installedItem = StaticBlueprints.GetBlueprintByID(src.InstalledItemTypeID); m_outputItemID = src.OutputTypeID; m_outputItem = GetOutputItem(src.OutputTypeID); m_runs = src.Runs; m_activity = (BlueprintActivity)Enum.ToObject(typeof(BlueprintActivity), src.ActivityID); m_blueprintType = (BlueprintType)Enum.ToObject(typeof(BlueprintType), src.InstalledItemCopy); m_installation = GetInstallation(src.OutputLocationID); m_solarSystem = StaticGeography.GetSystem(src.SolarSystemID); m_installedTime = src.InstallTime; m_installedItemME = src.InstalledItemMaterialLevel; m_installedItemPE = src.InstalledItemProductivityLevel; m_beginProductionTime = src.BeginProductionTime; m_endProductionTime = src.EndProductionTime; m_pauseProductionTime = src.PauseProductionTime; m_lastStateChange = DateTime.UtcNow; m_issuedFor = src.IssuedFor; m_activeJobState = GetActiveJobState(); }
/// <summary> /// Constructor from the API. /// </summary> /// <param name="src"></param> internal IndustryJob(SerializableJobListItem src) { m_state = GetState(src); m_jobID = src.JobID; m_installedItemID = src.InstalledItemTypeID; m_installedItem = StaticBlueprints.GetBlueprintByID(src.InstalledItemTypeID); m_outputItemID = src.OutputTypeID; m_outputItem = GetOutputItem(src.OutputTypeID); m_runs = src.Runs; m_activity = (BlueprintActivity) Enum.ToObject(typeof (BlueprintActivity), src.ActivityID); m_blueprintType = (BlueprintType) Enum.ToObject(typeof (BlueprintType), src.InstalledItemCopy); m_installation = GetInstallation(src.OutputLocationID); m_solarSystem = StaticGeography.GetSystem(src.SolarSystemID); m_installedTime = src.InstallTime; m_installedItemME = src.InstalledItemMaterialLevel; m_installedItemPE = src.InstalledItemProductivityLevel; m_beginProductionTime = src.BeginProductionTime; m_endProductionTime = src.EndProductionTime; m_pauseProductionTime = src.PauseProductionTime; m_lastStateChange = DateTime.UtcNow; m_issuedFor = src.IssuedFor; m_activeJobState = GetActiveJobState(); }
/// <summary> /// Constructor from an object deserialized from the settings file. /// </summary> /// <param name="src"></param> internal IndustryJob(SerializableJob src) { m_ignored = src.Ignored; m_jobID = src.JobID; m_state = src.State; m_installedItemID = src.InstalledItemID; m_installedItem = StaticBlueprints.GetBlueprintByID(src.InstalledItemID); m_outputItemID = src.OutputItemID; m_outputItem = GetOutputItem(src.OutputItemID); m_runs = src.Runs; m_activity = src.Activity; m_blueprintType = src.BlueprintType; m_installation = src.ItemLocation; m_solarSystem = StaticGeography.GetSystem(src.SolarSystemID); m_installedTime = src.InstalledTime; m_installedItemME = src.InstalledItemME; m_installedItemPE = src.InstalledItemPE; m_beginProductionTime = src.BeginProductionTime; m_endProductionTime = src.EndProductionTime; m_pauseProductionTime = src.PauseProductionTime; m_lastStateChange = src.LastStateChange; m_issuedFor = src.IssuedFor; m_activeJobState = GetActiveJobState(); }
public Blueprint(BlueprintType type = BlueprintType.Base, UInt32 width = 0, UInt32 height = 0, UInt32 depth = 0) { Version = 20; Type = type; Width = width; Height = height; Depth = depth; Unknown01 = 1; Unknown02 = 0; LightCount = 0; DoorCount = 0; DeviceCount = 0; UnknownCount02 = 0; UnknownCount03 = 0; TriangleCount = 0; MetaTags[MetaTagKey.GroundOffset] = new MetaTag03(MetaTagKey.GroundOffset) { Value = 0f, Unknown = 0 }; MetaTags[MetaTagKey.TerrainRemoval] = new MetaTagUInt16(MetaTagKey.TerrainRemoval) { Value = 0x0000 }; MetaTags[MetaTagKey.UnknownMetax0E] = new MetaTag03(MetaTagKey.UnknownMetax0E) { Value = 0f, Unknown = 0 }; MetaTags[MetaTagKey.UnknownMetax0F] = new MetaTag03(MetaTagKey.UnknownMetax0F) { Value = 0f, Unknown = 0 }; MetaTags[MetaTagKey.UnknownMetax05] = new MetaTagUInt16(MetaTagKey.UnknownMetax05) { Value = 0x0000 }; MetaTags[MetaTagKey.UnknownMetax04] = new MetaTag02(MetaTagKey.UnknownMetax04) { Value = 0, Unknown = 0 }; MetaTags[MetaTagKey.UnknownMetax06] = new MetaTag04(MetaTagKey.UnknownMetax06) { Value = new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }; MetaTags[MetaTagKey.GroupName] = new MetaTagString(MetaTagKey.GroupName) { Value = "" }; MetaTags[MetaTagKey.ChangedTime] = new MetaTag05(MetaTagKey.ChangedTime) { Value = DateTime.Now, Unknown = 0 }; MetaTags[MetaTagKey.BuildVersion] = new MetaTag02(MetaTagKey.BuildVersion) { Value = 1838, Unknown = 0 }; MetaTags[MetaTagKey.CreatorId] = new MetaTagString(MetaTagKey.CreatorId) { Value = "" }; MetaTags[MetaTagKey.CreatorName] = new MetaTagString(MetaTagKey.CreatorName) { Value = "" }; MetaTags[MetaTagKey.ChangedById] = new MetaTagString(MetaTagKey.ChangedById) { Value = "" }; MetaTags[MetaTagKey.ChangedByName] = new MetaTagString(MetaTagKey.ChangedByName) { Value = "" }; MetaTags[MetaTagKey.SpawnName] = new MetaTagString(MetaTagKey.SpawnName) { Value = "" }; MetaTags[MetaTagKey.UnknownMetax12] = new MetaTag05(MetaTagKey.UnknownMetax12) { Value = DateTime.MinValue, Unknown = 0 }; }
public static List<Blueprint> GetAllBlueprints(BlueprintType b) { return blueprints[b]; }
public EnemyResource(BlueprintType bp, int count) { BpType = bp; Count = count; }