bool OnGeneralSelectChange(int index) { generalIndex = index; generalInfo = Informations.Instance.GetGeneralInfo(index); kingPopupList.SetItemSelect(generalInfo.king); cityPopupList.SetItemSelect(generalInfo.city); weaponPopupList.SetItemSelect(generalInfo.equipment); magicPopupList.SetItemSelect(-1); sliderLevel.value = generalInfo.level / 50f; sliderStrength.value = generalInfo.strength / 120f; sliderIntellect.value = generalInfo.intellect / 120f; sliderHealthy.value = generalInfo.healthCur / 200f; sliderMana.value = generalInfo.manaCur / 200f; sliderSoldier.value = (generalInfo.soldierCur + generalInfo.knightCur) / 100f; for (int i = 0; i < 4; i++) { if (generalInfo.magic[i] == -1) { labelMagic[i].text = ""; } else { labelMagic[i].text = ZhongWen.Instance.GetMagicName(generalInfo.magic[i]); } } return(true); }
/// <summary> /// 通用报文 /// </summary> /// <param name="inputErpXmlSource">报文的Content内容</param> /// <returns></returns> public static string GlobalBW(string erpXmlSource) { GeneralInfo globalInfo = new GeneralInfo(); //XML格式化参数 globalInfo.appId = GlobalInfo.AppId; globalInfo.version = "1.0"; globalInfo.encryptCode = ConfigHelper.GetAppSettingValue("EncryptCode"); string requestDownLoadXML = string.Empty; globalInfo.passWord = CommonHelper.GetPassWord(Resources.Common.PassWord); try { //Test temp set to 3DES string encodeOrgXMLSource = CommonHelper.Get3DESEncodeContent(globalInfo.passWord, erpXmlSource); globalInfo.content = encodeOrgXMLSource; globalInfo.state = new ReturnStateInfo(); requestDownLoadXML = new JavaScriptSerializer().Serialize(globalInfo); } catch (Exception ex) { Logging.Log4NetHelper.Error(typeof(WSInterface), Message.GetGlobalFailed + ex.Message + System.Environment.NewLine + ex.StackTrace); } return(requestDownLoadXML); }
public async Task Uninstall_JungleFiles() { try { UpdateProgessBarText("_Uninstalling binary files...", false); if (currentMod.JungleFiles == null) { return; } foreach (var file in currentMod.JungleFiles) { if (File.Exists(GeneralInfo.GetPathInGameDir(file.filePath))) { File.Delete(GeneralInfo.GetPathInGameDir(file.filePath)); } } //Clear tracker currentMod.JungleFiles.Clear(); } catch (Exception ex) { SaveErrorLog(ex.ToString()); MessageBox.Show(string.Format("{0}\n\n{1}", ex.Message, (ex.InnerException != null) ? ex.InnerException.Message : ""), "Install Error", MessageBoxButton.OK, MessageBoxImage.Error); MessageBox.Show("Some installation changes cannot be reverted. The installer will now close.", "Uninstall Error", MessageBoxButton.OK, MessageBoxImage.Exclamation); parent.ShutdownApp(); } }
public static AppSettings LoadSettings() { try { //Try to load the settings YAXSerializer serializer = new YAXSerializer(typeof(AppSettings), YAXSerializationOptions.DontSerializeNullObjects); var settings = (AppSettings)serializer.DeserializeFromFile(GeneralInfo.SETTINGS_PATH); settings.InitSettings(); settings.ValidateSettings(); return(settings); } catch { //If it fails, create a new instance and save it to disk. var newSettings = new AppSettings() { }; newSettings.InitSettings(); newSettings.SaveSettings(); return(newSettings); } finally { GeneralInfo.UpdateEepkToolInterlop(); } }
public void SetGeneral(int gIdx) { generalIdx = gIdx; if (menuAnim == null) { menuAnim = GetComponent <MenuDisplayAnim>(); } menuAnim.SetAnim(MenuDisplayAnim.AnimType.InsertFromRight); GeneralInfo gInfo = Informations.Instance.GetGeneralInfo(gIdx); for (int i = 0; i < formations.Length; i++) { if ((gInfo.formation & (1 << i)) == 0) { formations[i].SetButtonEnable(false); } else { formations[i].SetButtonEnable(true); if (gInfo.formationCur == (1 << i)) { token.position = new Vector3(token.position.x, formations[i].transform.position.y, token.position.z); } } } }
private void Awake() { if (instance == null) { DontDestroyOnLoad(gameObject); instance = this; } else if (instance != this) { Destroy(gameObject); } if (GameObject.Find("Login Controller") != null) { loginController.GetComponent <ButtonLoginRegister>().SetGeneralInfoReference(this); } else if (GameObject.Find("Menu Controller") != null) { menuController.GetComponent <ButtonMenu>().SetGeneralInfoReference(this); } else if (GameObject.Find("Score Controller") != null) { scoreController.GetComponent <ScoreMenu>().SetGeneralInfoReference(this); } else if (GameObject.Find("Game Controller") != null) { gameController.GetComponent <GameController>().SetGeneralInfoReference(this); } else if (GameObject.Find("Post Game Controller") != null) { PostGameController.GetComponent <postGameController>().SetGeneralInfoReference(this); } }
private void bw_DoWork(object sender, DoWorkEventArgs e) { int userID = Convert.ToInt32(e.Argument); BLL.User user = new User(); user.LoadByPrimaryKey(userID); try { HelperClasses.DirectoryServices.RefreshFromDirectoryServices(); BLL.GeneralInfo info = new GeneralInfo(); info.LoadAll(); info.LastSync = DateTime.Now; info.Save(); e.Result = "Completed!"; } catch (Exception ex) { if (user.UserType != UserType.Constants.SYSTEM_ADMIN) { e.Result = "There has been a network error. The database is not in sync with directory services. Please connect to the Internet and try again."; } else { e.Result = ex.Message; } } }
void OnEnable() { menuAnim.SetAnim(MenuDisplayAnim.AnimType.InsertFromRight); GeneralInfo gInfo = Informations.Instance.GetGeneralInfo(WarSceneController.rightGeneralIdx); if (warCtrl.rightGeneral.GetArmyAssaultFlag() || gInfo.soldierCur + gInfo.knightCur == 0) { for (int i = 0; i < 6; i++) { commands[i].SetButtonEnable(false); } } else { for (int i = 0; i < 6; i++) { commands[i].SetButtonEnable(true); } } if (warCtrl.rightGeneral.IsCanReleaseMagic()) { commands[6].SetButtonEnable(true); } else { commands[6].SetButtonEnable(false); } }
void AddGeneralToCity(int gIdx, int cIdx) { CityInfo cInfo = Informations.Instance.GetCityInfo(cIdx); GeneralInfo gInfo = Informations.Instance.GetGeneralInfo(gIdx); gInfo.active = 0; gInfo.king = cInfo.king; gInfo.city = cIdx; gInfo.loyalty = 90; gInfo.prisonerIdx = -1; int levelSum = 0; for (int i = 0; i < cInfo.generals.Count; i++) { levelSum += Informations.Instance.GetGeneralInfo(cInfo.generals[i]).level; } int level = levelSum / cInfo.generals.Count; gInfo.experience = Misc.GetLevelExperience(level); Misc.CheckIsLevelUp(gInfo); cInfo.generals.Add(gIdx); Informations.Instance.GetKingInfo(cInfo.king).generals.Add(gIdx); }
void OnGeneralSelectedHandler(object data) { int gIdx = (int)data; for (int i = 0; i < gList.Count; i++) { PushedButton pbtn = (PushedButton)gList[i]; if (pbtn.GetButtonData() == data) { GeneralInfo gInfo = Informations.Instance.GetGeneralInfo(gIdx); slider.transform.position = new Vector3(slider.transform.position.x, pbtn.transform.position.y, slider.transform.position.z); slider.SetSlider(gInfo.soldierMax + gInfo.knightMax, gInfo.soldierCur + gInfo.knightCur); selectIdx = i; } else { pbtn.SetButtonState(PushedButton.ButtonState.Normal); } } SetGeneralInfo(gIdx); UpdateChangeArms(gIdx); }
public static GeneralInfo GetGeneralInfo(GMFileContent content) { var ret = new GeneralInfo(); var ge = content.General; ret.IsDebug = ge->Debug; ret.FileName = StringFromOffset(content, ge->FilenameOffset); ret.Configuration = StringFromOffset(content, ge->ConfigOffset); ret.Name = StringFromOffset(content, ge->NameOffset); ret.DisplayName = StringFromOffset(content, ge->DisplayNameOffset); ret.GameId = ge->GameId; ret.WindowSize = ge->WindowSize; ret.BytecodeVersion = ge->BytecodeVersion; ret.Version = new Version(ge->Major, ge->Minor, ge->Release, ge->Build); ret.LicenseMD5Hash = new byte[0x10]; Marshal.Copy((IntPtr)ge->MD5, ret.LicenseMD5Hash, 0, 0x10); ret.LicenceCRC32 = ge->CRC32; ret.Timestamp = new DateTime(1970, 1, 1, 0, 0, 0).AddSeconds(ge->Timestamp); ret.WeirdNumbers = new uint[ge->NumberCount]; for (uint i = 0; i < ge->NumberCount; i++) { ret.WeirdNumbers[i] = (&ge->Numbers)[i]; } return(ret); }
private void Link_CreateMarginalHeaderArea(object sender, CreateAreaEventArgs e) { GeneralInfo info = new GeneralInfo(); info.LoadAll(); // old header //string header = info.HospitalName + "Inventory Log of " + lblAdjDate.Text; //header with reference number and date included //CalendarLib.DateTimePickerEx dtDate = new CalendarLib.DateTimePickerEx //{ // Value = DateTime.Now, // CustomFormat = "MM/dd/yyyy" //}; //DateTime dtCurrent = Convert.ToDateTime(dtDate.Text); DataRow dr = gridView2.GetFocusedDataRow(); string invDate = Convert.ToString(dr["Year"]); string header = info.HospitalName + "\n Inventory Log of Year " + invDate + " E.C\n Store: " + cboStores.Text; printableComponentLink1.Landscape = true; printableComponentLink1.PageHeaderFooter = header; TextBrick brick = e.Graph.DrawString(header, Color.Navy, new RectangleF(0, 0, 800, 100), DevExpress.XtraPrinting.BorderSide.None); brick.Font = new Font("Tahoma", 13); brick.StringFormat = new DevExpress.XtraPrinting.BrickStringFormat(StringAlignment.Center); }
public List <GeneralInfo> PlayerRead(GeneralInfo newUser) //данные игрока { BinaryFormatter formatter = new BinaryFormatter(); try { using (FileStream fs = new FileStream(AppDomain.CurrentDomain.BaseDirectory + "usersInfo.dat", FileMode.Open)) { return((List <GeneralInfo>)formatter.Deserialize(fs)); } } catch (Exception) { //ErrorEvent("Произошло создание нового списка для зарегестрированных пользователей"); List <GeneralInfo> newList = new List <GeneralInfo>(); if (newUser != null) { newList.Add(newUser); } else { GeneralInfo g = new GeneralInfo(); g.Name = "admin"; g.Password = "******"; newList.Add(g); } PlayerSave(newList); return(newList); } }
/// <summary> /// 调用服务端接口并获取返回报文对象 /// </summary> /// <param name="InterfaceType">接口枚举</param> /// <param name="result">是否上传或下载成功</param> /// <returns></returns> public static GeneralInfo GetResponseObject(string strRequest, InterfaceType InterfaceType) { GeneralInfo dyfpqzResponse = null; try { string requestDownLoadXML = GlobalBW(strRequest); if (!string.IsNullOrEmpty(requestDownLoadXML)) { requestDownLoadXML = System.Web.HttpUtility.UrlEncode(requestDownLoadXML, System.Text.Encoding.UTF8); string fpqzResponse = CommonHelper.HttpPost(ConfigHelper.GetAppSettingValue(InterfaceType.ToString()).ToString(), requestDownLoadXML); JavaScriptSerializer jserial = new JavaScriptSerializer(); dyfpqzResponse = jserial.Deserialize <GeneralInfo>(fpqzResponse); if (dyfpqzResponse.state.returnCode.ToString() != "0000") { Logging.Log4NetHelper.Error(typeof(WSInterface), string.Format(Message.GetResponseFailed, InterfaceType.GetDescription(), dyfpqzResponse.state.returnCode, dyfpqzResponse.state.returnMessage)); } } } catch (Exception ex) { Logging.Log4NetHelper.Error(typeof(WSInterface), string.Format(Message.GetResponseException, InterfaceType.GetDescription()) + ex.Message + System.Environment.NewLine + ex.StackTrace); throw; } return(dyfpqzResponse); }
public GeneralInfo General(int?customerId = default(int?)) { var generalInfo = new GeneralInfo(); generalInfo.count = DataManager.GetAuctionsCount(customerId: CurrentUser.CustomerId); var auctions = DataManager.GetAuctions(1, generalInfo.count, customerId: CurrentUser.CustomerId); foreach (var auction in auctions) { if (auction.StatusId == FINISHED_STATUS) { generalInfo.finished += 1; } if (auction.StatusId == NOT_HELD_STATUS) { generalInfo.notHeld += 1; } if (auction.StatusId == EXPECTED_STATUS) { generalInfo.expected += 1; } } return(generalInfo); }
/// <summary> /// Takes the database backup path from the registry /// </summary> private static void BackUpDatabase() { try { GeneralInfo info = new GeneralInfo(); info.LoadAll(); string path = GetDBAutoBackupPath() + "\\" + info.HospitalName + "PharmaInventory" + DateTime.Now.ToString("MMMddyyyy") + ".bak"; string connectionString = PharmInventory.HelperClasses.DatabaseHelpers.GetConnectionString(); System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(connectionString); System.Data.SqlClient.SqlCommand com = new System.Data.SqlClient.SqlCommand(); if (!(conn.State == ConnectionState.Open)) { conn.Open(); } string dbName = conn.Database; com.CommandText = "BACKUP DATABASE [" + dbName + "] TO DISK = N'" + path + "' WITH NOFORMAT, NOINIT, NAME = N'PharmaInventory" + DateTime.Now.ToString("MMMddyyyy") + "-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10"; com.Connection = conn; com.ExecuteNonQuery(); info.LoadAll(); info.LastBackUp = DateTime.Now; info.Save(); XtraMessageBox.Show("Backup completed to " + path + "!", "Completed", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch { XtraMessageBox.Show("Backup has failed! Please Try Again.", "Try Again", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public static double[] getlistofcolumnnameis0to17columnsvaluesfrom_GeneralInfo() { double[] li = new double[18]; for (int i = 0; i < 18; i++) { li[i] = 0; } PEIEntities7 Ganesh = new PEIEntities7(); GeneralInfo empQuery = Ganesh.GeneralInfoes.FirstOrDefault(); if (1 < 2) { li[0] = empQuery.C0 ?? 0; li[1] = empQuery.C1 ?? 0; li[2] = empQuery.C2 ?? 0; li[3] = empQuery.C3 ?? 0; li[4] = empQuery.C4 ?? 0; li[5] = empQuery.C5 ?? 0; li[6] = empQuery.C6 ?? 0; li[7] = empQuery.C7 ?? 0; li[8] = empQuery.C8 ?? 0; li[9] = empQuery.C9 ?? 0; li[10] = empQuery.C10 ?? 0; li[11] = empQuery.C11 ?? 0; li[12] = empQuery.C12 ?? 0; li[13] = empQuery.C13 ?? 0; li[14] = empQuery.C14 ?? 0; li[15] = empQuery.C15 ?? 0; li[16] = empQuery.C16 ?? 0; li[17] = empQuery.C17 ?? 0; } return(li); }
void OnGoToGeneralController() { timeTick += Time.deltaTime; if (timeTick >= 0.2f) { timeTick = 0; gameObject.SetActive(false); GeneralInfo gInfo = Informations.Instance.GetGeneralInfo(generalSelected); if (gInfo.city != -1) { choiceTarget.AddCityTarget(gInfo.city); choiceTarget.Show(); } else { foreach (ArmyInfo armyInfo in Informations.Instance.armys) { foreach (int gIdx in armyInfo.generals) { if (gIdx == generalSelected) { choiceTarget.AddArmyTarget(armyInfo); choiceTarget.Show(); return; } } } } } }
void WarResult(GeneralInfo winner, GeneralInfo loser, int experience) { //winner.experience += experience; winner.experience += (Misc.GetLevelExperience(winner.level + 1) - Misc.GetLevelExperience(winner.level)) / 2; CheckLevelUp(winner); int hourse = 0; if (loser.equipment == 27 || loser.equipment == 28 || loser.equipment == 29 || loser.equipment == 30) { hourse = 1; } if (loser == Informations.Instance.GetGeneralInfo(Informations.Instance.GetKingInfo(loser.king).generalIdx)) { if (Informations.Instance.GetKingInfo(loser.king).cities.Count > 0) { hourse += 3; } } if (!WarSceneController.isEscape && Random.Range(0, 100) > 50 + hourse * 25 - loser.escape * 25) { loser.prisonerIdx = winner.king; isPrisoned = true; loser.escape = 0; } else { isPrisoned = false; loser.escape++; } }
void OnSelectGeneralHandler() { if (state != 0) { return; } state = 1; int idx = (int)generalsList.GetSelectItem().GetItemData(); generalSelected = idx; GeneralInfo gInfo = Informations.Instance.GetGeneralInfo(idx); cityInfo.SetCity(gInfo.city); map.ClearSelect(); map.SelectCity(gInfo.city); confirmBox.SetActive(true); confirmBox.transform.position = new Vector3(confirmBox.transform.position.x, generalsList.GetSelectItem().transform.position.y, confirmBox.transform.position.z); generalsList.enabled = false; }
private async Task <Response> GetResponse(SqlResponseCommand command) { //var responder = command switch { // SqlResponseCommand.GeneralInfo => new GeneralInfo(ConnectionString), // SqlResponseCommand.TableList => new TableList(ConnectionString), // _ => new Error() //}; //return responder.GetResponse(); ICommandResponder responder; switch (command) { case SqlResponseCommand.GeneralInfo: responder = new GeneralInfo(ConnectionString); break; case SqlResponseCommand.TableList: responder = new TableList(ConnectionString); break; default: responder = new Error(); break; } return(await responder.GetResponse()); }
public void SetGeneral(int idx) { GeneralInfo gInfo = Informations.Instance.GetGeneralInfo(idx); for (int i = 0; i < gInfo.magic.Length; i++) { int mIdx = gInfo.magic[i]; if (mIdx == -1) { magic[i].gameObject.SetActive(false); continue; } string mName = ZhongWen.Instance.GetMagicName(mIdx); string text = mName[0].ToString(); for (int j = 1; j < mName.Length; j++) { text += "\n" + mName[j]; } magic[i].text = text; } }
// Use this for initialization void Start() { //GameObject camGO = GameObject.FindWithTag("CameraMan"); GameObject camGO = GameObject.FindWithTag("MainCamera"); transform.parent = camGO.transform; transform.localPosition = new Vector3(0, yFrom, -20); transform.localScale = scaleFrom; parts = GetComponent <ParticleSystem>(); int healthyAdd = MagicController.Instance.GetMagicAttack(); if (MagicController.Instance.GetMagicSide() == WarSceneController.WhichSide.Left) { gInfo = Informations.Instance.GetGeneralInfo(WarSceneController.leftGeneralIdx); } else { gInfo = Informations.Instance.GetGeneralInfo(WarSceneController.rightGeneralIdx); } healthyOrg = gInfo.healthCur; healthyFinally = gInfo.healthCur + healthyAdd; if (healthyFinally > gInfo.healthMax) { healthyFinally = gInfo.healthMax; } SoundController.Instance.PlaySound("00012"); }
void OnGeneralDialogueDownMdoeHandler() { timeTick += Time.deltaTime; if (timeTick < 0.2f) { return; } timeTick = 0; state = 2; GeneralInfo gInfo = Informations.Instance.GetGeneralInfo(selectGeneralIdx); gInfo.active = 0; generalsList.enabled = true; generalsList.GetSelectItem().SetSelectEnable(false); generalsList.SetItemSelected(-1, false); cityInfo.gameObject.SetActive(true); cityInfo.SetCity(gInfo.city); cityInfo.GetComponent <MenuDisplayAnim>().SetAnim(MenuDisplayAnim.AnimType.InsertFromBottom); map.ClearSelect(); map.SelectCity(gInfo.city); }
private void GetLastBackupAndSyncDates() { GeneralInfo info = new GeneralInfo(); info.LoadAll(); TimeSpan tt = new TimeSpan(); if (!info.IsColumnNull("LastBackUp")) { string lastBackupDt = info.LastBackUp.ToString("MMM dd,yyyy") + " (" + DateTime.Now.Subtract(info.LastBackUp).Days + " days ago)";; lblLastBackupDate.Text = "Last Backup Date: " + lastBackupDt; } if (!info.IsColumnNull("LastSync")) { int days = DateTime.Now.Subtract(info.LastSync).Days; string lastSyncDt; if (days != 0) { lastSyncDt = info.LastSync.ToString("MMM dd,yyyy") + " (" + days + " days ago)"; } else { lastSyncDt = info.LastSync.ToString("MMM dd,yyyy") + " (Today)"; } lblLastSyncDate.Text = "Last Sync Date: " + lastSyncDt; } }
public static JsonData SerializeGeneral(GeneralInfo gen8) { var r = CreateObj(); r["debug"] = gen8.IsDebug; r["bytecodeversion"] = gen8.BytecodeVersion; r["filename"] = gen8.FileName; r["config"] = gen8.Configuration; r["gameid"] = gen8.GameID; r["name"] = gen8.Name; r["version"] = gen8.Version.ToString(); r["windowsize"] = SerializeSize(gen8.WindowSize); r["licensemd5"] = SerializeArray(gen8.LicenseMD5Hash, Utils.Identity); r["licensecrc32"] = gen8.LicenceCRC32; r["displayname"] = gen8.DisplayName; r["timestamp"] = gen8.Timestamp.ToString(SR.SHORT_L /* 's': sortable */); r["targets"] = gen8.ActiveTargets.ToString(); r["unknown"] = SerializeArray(gen8.unknown, Utils.Identity); r["appid"] = gen8.SteamAppID; r["flags"] = gen8.InfoFlags.ToString(); r["numbers"] = SerializeArray(gen8.WeirdNumbers, Utils.Identity); return(r); }
private void printableComponentLink1_CreateMarginalHeaderArea(object sender, DevExpress.XtraPrinting.CreateAreaEventArgs e) { var info = new GeneralInfo(); info.LoadAll(); int year = Convert.ToInt32(cboYear.EditValue); int month = 10; int day = 30; if (year == dtCurrent.Year) { month = dtCurrent.Month; day = dtCurrent.Day; } DateTime startDate = EthiopianDate.EthiopianDate.EthiopianToGregorian(String.Format("{0}/{1}/{2}", 1, 11, year - 1)); DateTime endDate = EthiopianDate.EthiopianDate.EthiopianToGregorian(String.Format("{0}/{1}/{2}", day, month, year)); DateTime currentDate = EthiopianDate.EthiopianDate.EthiopianToGregorian(String.Format("{0}/{1}/{2}", dtCurrent.Day, dtCurrent.Month, dtCurrent.Year)); string strStartDate = EthiopianDate.EthiopianDate.GregorianToEthiopian(startDate); string strEndDate = EthiopianDate.EthiopianDate.GregorianToEthiopian(endDate); string strCurrentDate = EthiopianDate.EthiopianDate.GregorianToEthiopian(currentDate); string[] header = { info.HospitalName, "Store: " + cboStores.Text, " From Start Date: " + strStartDate, " To End Date: " + strEndDate, "Printed Date: " + strCurrentDate }; printableComponentLink1.Landscape = true; printableComponentLink1.PageHeaderFooter = header; TextBrick brick = e.Graph.DrawString(header[0], Color.DarkBlue, new RectangleF(0, 0, 200, 100), BorderSide.None); TextBrick brick1 = e.Graph.DrawString(header[1], Color.DarkBlue, new RectangleF(0, 20, 200, 100), BorderSide.None); TextBrick brick2 = e.Graph.DrawString(header[2], Color.DarkBlue, new RectangleF(0, 40, 200, 100), BorderSide.None); TextBrick brick3 = e.Graph.DrawString(header[3], Color.DarkBlue, new RectangleF(160, 40, 200, 100), BorderSide.None); TextBrick brick4 = e.Graph.DrawString(header[4], Color.DarkBlue, new RectangleF(0, 60, 200, 100), BorderSide.None); }
void OnCityInfoDownModeHandler() { timeTick += Time.deltaTime; if (timeTick < 0.2f) { return; } timeTick = 0; state = 4; cityInfo.gameObject.SetActive(false); GeneralInfo gInfo = Informations.Instance.GetGeneralInfo(selectGeneralIdx); CityInfo cInfo = Informations.Instance.GetCityInfo(gInfo.city); int populationAdd = 9000 + Random.Range(0, 1000) + Random.Range(0, (gInfo.intellect - 80) * 100); cInfo.population += populationAdd; cInfo.population = Mathf.Clamp(cInfo.population, cInfo.population, 999999); string msg = ZhongWen.Instance.GetCityName(gInfo.city) + ZhongWen.Instance.kaifa + populationAdd; bottomDialogue.SetDialogue(selectGeneralIdx, msg, MenuDisplayAnim.AnimType.InsertFromBottom); }
public bool AddPrisonsList() { int king = Controller.kingIndex; for (int i = 0; i < Informations.Instance.generalNum; i++) { GeneralInfo gInfo = Informations.Instance.GetGeneralInfo(i); if (gInfo.prisonerIdx == king) { havePrison = true; ListItem li = prisonerList.AddItem(ZhongWen.Instance.GetGeneralName1(i)); li.SetItemData(i); if (gInfo.active == 0) { li.SetSelectEnable(false); } } } if (!havePrison) { kingDialogue.SetDialogue(Informations.Instance.GetKingInfo(king).generalIdx, ZhongWen.Instance.zhaoxiang_no, MenuDisplayAnim.AnimType.InsertFromBottom); } return(havePrison); }
void OnGeneralDialogueDownMdoeHandler() { timeTick += Time.deltaTime; if (timeTick < 0.2f) { return; } timeTick = 0; if (findWhat == 1) { state = 6; bottomDialogue.SetDialogue(Informations.Instance.GetKingInfo(Controller.kingIndex).generalIdx, ZhongWen.Instance.GetGeneralName(findGeneralIdx) + ZhongWen.Instance.sousuo_rencai_ask, MenuDisplayAnim.AnimType.InsertFromBottom); } else { state = 2; GeneralInfo gInfo = Informations.Instance.GetGeneralInfo(selectGeneralIdx); gInfo.active = 0; generalsList.enabled = true; generalsList.GetSelectItem().SetSelectEnable(false); generalsList.SetItemSelected(-1, false); cityInfo.gameObject.SetActive(true); cityInfo.SetCity(gInfo.city); cityInfo.GetComponent <MenuDisplayAnim>().SetAnim(MenuDisplayAnim.AnimType.InsertFromBottom); map.ClearSelect(); map.SelectCity(gInfo.city); } }
public static GeneralInfo getInstance() { if (instance == null) { instance = new GeneralInfo(); } return instance; }
public void Dispose() { _videoStreams = 0; _audioStreams = 0; Video = new List<VideoStreamInfo>(); Audio = new List<AudioStreamInfo>(); Image = new List<ImageStreamInfo>(); Text = new List<TextStreamInfo>(); Chapters = new List<TimeSpan>(); General = new GeneralInfo(); }
public MediaInfoContainer() { _videoStreams = 0; _audioStreams = 0; General = new GeneralInfo(); Video = new List<VideoStreamInfo>(); Audio = new List<AudioStreamInfo>(); Image = new List<ImageStreamInfo>(); Text = new List<TextStreamInfo>(); Chapters = new List<TimeSpan>(); }
static GeneralConfig() { if (String.IsNullOrEmpty(configFile)) { try { configFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "App_Data/General.config"); } catch { throw new Exception("The Config File Not Found!"); } } configFileLastUpdate = File.GetLastWriteTime(configFile).ToString(); info = (GeneralInfo)XMLSerializer.Load(typeof(GeneralInfo), configFile); }
// Use this for initialization void Start() { selectedBall = GameObject.Find("1").GetComponent<Transform>().position; solidCount = stripeCount = 7; gc = GameControl.getInstance (); generalInfo = GeneralInfo.getInstance(); getCueInfo (); getCueStickInfo(); setCueStick(); //MYO TESTS //cueStickRB.constraints = RigidbodyConstraints.FreezePositionY; //cueStickCollider.enabled = false; ThalmicHub hub = ThalmicHub.instance; thalmicMyo = myo.GetComponent<ThalmicMyo> (); }
private void pictureBox1_MouseClick(object sender, MouseEventArgs e) { if (e.Button == System.Windows.Forms.MouseButtons.Right) { long time = DateTime.UtcNow.Ticks / 10000; if (time < lastclick + 1000) { z("Faking crash"); try { Program.popception(); } catch (Exception ex) { throw ex; // UNCOMMENT for production SerializableException se = new SerializableException(ex); GeneralInfo gi = new GeneralInfo(se, ex); string serialized = gi.ToString(); } Clipboard.Clear(); Application.DoEvents(); Clipboard.SetText(Program.DBGLOG); Application.DoEvents(); MessageBox.Show("Debug information placed on clipboard\n\nGo to pastebin and Ctrl-V"); } lastclick = time; } }
public void SetGeneralInfo(int idx, GeneralInfo gInfo) { //if (generals == null) //{ // generals = new GeneralInfo[generalNum]; //} //generals[idx] = gInfo; }
private void InitDefaultGeneralsInfo() { int[] skillids = new int[] { 1001, 1002, 1003, 1004, 1201, 1202, 1203 }; int sid = 0; foreach (var genData in GameData.GeneralData.dataMap) { int gIdx = genData.Key; GeneralInfo info = new GeneralInfo(); info.id = gIdx; //info.level = UnityEngine.Random.Range(1, GeneralInfo.LEVEL_LIMIT + 1); info.healthCur = info.propData.hp; generals.Add(info); foreach (int skid in skillids) { SkillStateData data = new SkillStateData(); data.skillID = skid; //data.state = (SkillState)(UnityEngine.Random.Range(0, (int)SkillState.Count)); info.skills.Add(data); } if (info.gamedata.adviser && mine.advisers.Count < GeneralInfo.ASVISER_COUNT_LIMIT) { mine.advisers.Add(info.id); } uint[] equiplist = new uint[1115 - 1109 + 1] { 1109, 1110, 1111, 1112, 1113, 1114, 1115 }; List<uint> elist = new List<uint>(); elist.AddRange(equiplist); for (int i = 0; i < GeneralInfo.EQUIP_COUNT_LIMIT; ++i) { t_ObjectProto equip = new t_ObjectProto(); equip.lv = 1; //int idex = UnityEngine.Random.Range(0, elist.Count); //equip.dwObjectID = equiplist[idex]; //elist.Remove(equip.dwObjectID); //info.equips[i] = equip; } sid += GeneralInfo.SOLDIER_LIMIT; } }
// Use this for initialization void Start() { generalInfo = GeneralInfo.getInstance(); }
public int AddGeneralInfo(GeneralInfo inf) { if (!generals.Contains(inf)) generals.Add(inf); return generals.Count; }