Exemple #1
0
		//TODO: Implement events

		//public void Create()
		//{
		//	RealmWorldDBMgr.DatabaseProvider.Save(this);
		//	OnCreated();
		//}

		//public void CreateAndFlush()
		//{
		//	RealmWorldDBMgr.DatabaseProvider.Save(this);
		//	OnCreated();
		//}

		//private void OnCreated()
		//{
		//	foreach (var right in m_BankTabRights)
		//	{
		//		RealmWorldDBMgr.DatabaseProvider.Save(right);
		//	}
		//}

		//protected void OnDelete()
		//{
		//	base.OnDelete();
		//	foreach (var right in m_BankTabRights)
		//	{
		//		RealmWorldDBMgr.DatabaseProvider.Delete(right);
		//	}
		//}

		/// <summary>
		/// Init a loaded Rank
		/// </summary>
		internal void InitRank()
		{
			m_BankTabRights = RealmWorldDBMgr.DatabaseProvider.Query<GuildBankTabRights>().Where(guildBankTabRights => guildBankTabRights.GuildRankId == _id).ToArray(); //GuildBankTabRights.FindAllByProperty("m_GuildRankId", _id);
			var count = m_BankTabRights.Length;
			Array.Resize(ref m_BankTabRights, GuildMgr.MAX_BANK_TABS);
			for (var i = count; i < m_BankTabRights.Length; i++)
			{
				m_BankTabRights[i] = new GuildBankTabRights(i, (uint)_id);
			}
		}
Exemple #2
0
		public GuildRank(Guild guild, string name, GuildPrivileges privileges, int id)
		{
			_id = (int)NextId();
			GuildId = (uint)guild.Id;	 //TODO: Conversion from int to uint, find a way to solve this
			Name = name;
			Privileges = privileges;
			RankIndex = id;
			BankTabRights = new GuildBankTabRights[GuildMgr.MAX_BANK_TABS];
			for (var i = 0; i < GuildMgr.MAX_BANK_TABS; ++i)
			{
				BankTabRights[i] = new GuildBankTabRights(i, (uint)_id);
			}
		}