//=================================================================================== // // Default Method // //=================================================================================== public override void Init() { if (_TitleLabel != null) { _TitleLabel.text = StringTableManager.GetData(3494); } _GuildSearchButton.SetLabel(StringTableManager.GetData(6750)); // 6750 길드 검색 if (_MyGuild == null) { _MyGuild = UIResourceMgr.CreatePrefab <MyGuild>(BUNDLELIST.PREFABS_UI_GUILD, transform, "MyGuild"); _MyGuild.Init(this); } if (_GuildList == null) { _GuildList = UIResourceMgr.CreatePrefab <GuildList>(BUNDLELIST.PREFABS_UI_GUILD, transform, "GuildList"); _GuildList.Init(); } if (m_GuildDelegationPopupWindow == null) { m_GuildDelegationPopupWindow = UIResourceMgr.CreatePrefab <GuildDelegation>(BUNDLELIST.PREFABS_UI_GUILD, transform, "GuildDelegation"); m_GuildDelegationPopupWindow.Init(); m_GuildDelegationPopupWindow.CloseUI(); } m_iGuildDelegateCountGold = (int)CDATA_FIXED_CONSTANTS.Get(DATA_FIXED_CONSTANTS._enConstant.Guild_Delegate_Count_Gold).Value; SetMenu(enMyGuildMain_ButtonType.MyGuild); }
static void Main() { //Lets create a few gamers Gamer gamer = new Gamer(new GamerInfo { Name = "Ivan", LastName = "Ivanov", Age = 18, Country = "Russia", Gender = "male" }); Gamer gamer2 = new Gamer(new GamerInfo { Name = "Jill", LastName = "Anderson", Age = 25, Country = "USA", Gender = "female" }); Console.WriteLine("Gamers {0} and {1} were created.", gamer.PersonalInfo.Name, gamer2.PersonalInfo.Name); Console.WriteLine(); Console.WriteLine("-------------------------------"); //Lets create our guild MyGuild guild = MyGuild.CreateNewMyGuild("SomeGuild", gamer); Console.WriteLine("Guild {0} with {1} as it's master was created.", guild.GuildInfo.GuildName, gamer.PersonalInfo.Name); Console.WriteLine(); Console.WriteLine("-------------------------------"); //Check if this unrelated player belongs to guild (spoiler: he doesn't) guild.CheckIfBelongToGuild(gamer2); Console.WriteLine("Player {0} is not yet in {1}.", gamer2.PersonalInfo.Name, guild.GuildInfo.GuildName); Console.WriteLine(); Console.WriteLine("-------------------------------"); //Lets try and add unrelated player bool result = guild.TryAddMembers(gamer2); Console.WriteLine("We tried to add {0} to the guild, but he's not invited yet, so the result was {1}.", gamer2.PersonalInfo.Name, result); Console.WriteLine(); Console.WriteLine("-------------------------------"); //Here goes logic to decide whether is player worthy enough, to be invited to join the guild Func <Gamer, bool> worthinessChecker = (x) => true; //Lets try to invite our player now, preliminarily checking he's worthiness result = guild.TryInviteNewMembers(worthinessChecker, gamer2); Console.WriteLine("We tried to invite {0} to the guild, and the result was {1}.", gamer2.PersonalInfo.Name, result); Console.WriteLine(); Console.WriteLine("-------------------------------"); //Now we can add him result = guild.TryAddMembers(gamer2); Console.WriteLine("Now we can add {0} to the guild, aren't we? {1}.", gamer2.PersonalInfo.Name, result); Console.WriteLine(); Console.WriteLine("-------------------------------"); //Lets check if he belongs now result = guild.CheckIfBelongToGuild(gamer2); Console.WriteLine("And finally {0} belongs to the guild! Am I right? {1}.", gamer2.PersonalInfo.Name, result); Console.Read(); }
//=================================================================================== // // Method // //=================================================================================== public void Init(_stGuildAttendanceAck stAck, MyGuild myGuild) { _MyGuild = myGuild; for (int i = 0; i < _GuildGoddnessBuffLabelList.Count; ++i) { _GuildGoddnessBuffLabelList[i].text = string.Empty; } _GuildTributeKindLabel.text = string.Empty; // 6904 여신의 신전에서 우편함으로 봉헌 감사 선물을 전달했습니다. _ContextLabel.text = StringTableManager.GetData(6904); // 6311 아무 곳이나 터치하시면 이전 화면으로 돌아갑니다. _CloseAreaButtonLabel.text = StringTableManager.GetData(6311); DATA_GUILD_MAIN GuildMainData = CDATA_GUILD_MAIN.Get(stAck.kResultGuildLevel); if (GuildMainData == null) { return; // error } DATA_GUILD_TRIBUTE._enTributeEnum TributeEnum = stAck.kGuildTributeKind; DATA_GUILD_TRIBUTE GuildTributeData = CDATA_GUILD_TRIBUTE.Get(TributeEnum); if (GuildTributeData == null) { return; // error } // 여신 이미지 셋팅. { _GoddnessFree.SetActive(false); _GoddnessGood.SetActive(false); _GoddnessExtra.SetActive(false); if (GuildTributeData.enTributeEnum.ToString().IndexOf("free", System.StringComparison.OrdinalIgnoreCase) != -1) { _GoddnessFree.SetActive(true); } else if (GuildTributeData.enTributeEnum.ToString().IndexOf("good", System.StringComparison.OrdinalIgnoreCase) != -1) { _GoddnessGood.SetActive(true); } else if (GuildTributeData.enTributeEnum.ToString().IndexOf("extra", System.StringComparison.OrdinalIgnoreCase) != -1) { _GoddnessExtra.SetActive(true); } } _GuildTributeKindLabel.text = string.Format(StringTableManager.GetData(GuildTributeData.iBuffTitle), GuildMainData.iGuildLv); int iLabelCount = 0; float Percent = 0.0f; if (GuildTributeData.fbuff_Gold > 0) { Percent = (GuildTributeData.fbuff_Gold * 100); _GuildGoddnessBuffLabelList[iLabelCount].text = string.Format(StringTableManager.GetData(6890), Percent.ToString("F2")); iLabelCount++; } if (GuildTributeData.fbuff_Pexp > 0) { Percent = (GuildTributeData.fbuff_Pexp * 100); _GuildGoddnessBuffLabelList[iLabelCount].text = string.Format(StringTableManager.GetData(6891), Percent.ToString("F2")); iLabelCount++; } if (GuildTributeData.fbuff_Cexp > 0) { Percent = (GuildTributeData.fbuff_Cexp * 100); _GuildGoddnessBuffLabelList[iLabelCount].text = string.Format(StringTableManager.GetData(6892), Percent.ToString("F2")); iLabelCount++; } }
public MyGuildTests() { _testGuild = MyGuild.CreateNewMyGuild("TestGuild", new Gamer(new GamerInfo { Name = "Ivan", LastName = "Ivanov", Age = 18, Country = "Russia", Gender = "male" })); }