public override void Initialize(int i, AResources resource) { base.Initialize(i, resource); farmPower = res.farmFoodT; shortDescription = "Food farms are used to generate " + res.farmFoodT + " food each turn."; longDescription = "Food farms are used to generate " + res.farmFoodT + " food each turn. You can also link a house to a food farm and you will gain an additional 5 food each turn. This effect also applies if you link a food farm to a house."; }
public override void Initialize(int i, AResources resource) { base.Initialize(i, resource); factoryPower = res.factoryMaterialsT; shortDescription = "Factories are used to generate " + res.factoryMaterialsT + " materials each turn."; longDescription = "Factories are used to generate " + res.factoryMaterialsT + " materials each turn. You can also link a house to a factory and you will gain an additional 5 materials each turn. The effect also applies if you link a factory to a house."; }
void Start() { lr = GetComponent<LineRenderer>(); resources = GetComponent<IdManager>().res; lr.SetPosition(0, transform.position + Vector3.forward); lr.SetPosition(1, transform.position + Vector3.forward); }
public override void Initialize(int i, AResources resource) { base.Initialize(i, resource); housePower = res.houseCitizensT; res.maximumCitizens += housePower; shortDescription = "Houses increase the maximum number of citizens you can have by " + res.houseCitizensT + "."; longDescription = "Houses increase the maximum number of citizens you can have by " + res.houseCitizensT + ". Houses can also be linked to other houses for an additional 150 Citizens."; }
public void updateTarget(GameObject target) { Target = target; lr = GetComponent<LineRenderer>(); resources = GetComponent<IdManager>().res; if (resources.buildings[target.GetComponent<IdManager>().buildingIndex].comradeIndex != 0) { lr.SetPosition(1, target.transform.position + Vector3.forward); } if (resources.buildings[target.GetComponent<IdManager>().buildingIndex].comradeIndex == gameObject.GetComponent<IdManager>().buildingIndex) { target.GetComponent<LineRenderer>().materials[0] = mat; lr.materials[0] = mat; lr.material = mat; target.GetComponent<LineRenderer>().material = mat; } }
public override void Initialize(int index, AResources resource) { base.Initialize(index, resource); res.maximumCitizens += 450; }
public override void Initialize(int index, AResources resource) { base.Initialize(index, resource); res.approval += 10; res.approvalDecayRate -= 10f; }
public virtual void Initialize(int index, AResources resource) { listIndex = index; res = resource; substractCost(); }
public override void Initialize(int index, AResources resource) { base.Initialize(index, resource); res.researchPoints++; }
/// <summary> /// Loads image and returns its data in .bmp file format. /// Returns null if fails, for example file not found or invalid Base64 string. /// </summary> /// <param name="s">Depends on t. File path or resource name without prefix or Base64 image data without prefix.</param> /// <param name="t">Image type and string format.</param> /// <param name="searchPath">Use <see cref="AFile.SearchPath"/></param> /// <remarks>Supports environment variables etc. If not full path, searches in <see cref="AFolders.ThisAppImages"/>.</remarks> public static byte[] BmpFileDataFromString(string s, ImageType t, bool searchPath = false) { //AOutput.Write(t, s); try { switch (t) { case ImageType.Bmp: case ImageType.PngGifJpg: case ImageType.Cur: if (searchPath) { s = AFile.SearchPath(s, AFolders.ThisAppImages); if (s == null) { return(null); } } else { if (!APath.IsFullPathExpandEnvVar(ref s)) { return(null); } s = APath.Normalize(s, AFolders.ThisAppImages); if (!AFile.ExistsAsFile(s)) { return(null); } } break; } switch (t) { case ImageType.Base64CompressedBmp: return(AConvert.Decompress(Convert.FromBase64String(s))); case ImageType.Base64PngGifJpg: using (var stream = new MemoryStream(Convert.FromBase64String(s), false)) { return(_ImageToBytes(Image.FromStream(stream))); } case ImageType.Resource: return(_ImageToBytes(AResources.GetAppResource(s) as Image)); case ImageType.Bmp: return(File.ReadAllBytes(s)); case ImageType.PngGifJpg: return(_ImageToBytes(Image.FromFile(s))); case ImageType.Ico: case ImageType.IconLib: case ImageType.ShellIcon: case ImageType.Cur: return(_IconToBytes(s, t == ImageType.Cur, searchPath)); } } catch (Exception ex) { ADebug.Print(ex.Message + " " + s); } return(null); }
public void res(AResources resource) { resources = resource; }
public override void Initialize(int i, AResources resource) { base.Initialize(i, resource); res.maximumCitizens = numberOfCitizens; }