/// <summary> /// /// </summary> /// <param name="guild"></param> /// <param name="taxCollectorDAO"></param> /// <returns></returns> public TaxCollectorEntity CreateTaxCollector(GuildInstance guild, TaxCollectorDAO taxCollectorDAO) { var taxCollector = new TaxCollectorEntity(guild, taxCollectorDAO); taxCollector.StartAction(GameActionTypeEnum.MAP); taxCollector.Map.SubArea.TaxCollector = taxCollector; m_taxCollectorById.Add(taxCollector.Id, taxCollector); return(taxCollector); }
public static bool IsRegister(GuildInstance guild) { var guildArena = GuildArenaRecord.GuildsArena.Find(x => x.FirstGuildId == guild.Id); if (guildArena == null) { return(false); } else { return(true); } }
/// <summary> /// /// </summary> public TaxCollectorEntity(GuildInstance guild, TaxCollectorDAO record) : base(EntityTypeEnum.TYPE_TAX_COLLECTOR, record.Id) { DatabaseRecord = record; Guild = guild; MapId = DatabaseRecord.MapId; CellId = DatabaseRecord.CellId; Defenders = new List <GuildMember>(); FarmedItems = new Dictionary <int, int>(); Statistics = new GenericStats(); Statistics.Merge(guild.Statistics.BaseStatistics); SpellBook = SpellBookFactory.Instance.Create(this); Storage = new TaxCollectorInventory(this); }
public GuildCreationResultEnum CreateGuild(Character owner, string name, GuildEmblem emblem) { ContextGuildEmblem contextEmblem = ContextGuildEmblem.New(emblem); if (name.Contains('\'') || GuildRecord.Exist(name)) { return(GuildCreationResultEnum.GUILD_CREATE_ERROR_NAME_ALREADY_EXISTS); } if (GuildRecord.Exist(contextEmblem)) { return(GuildCreationResultEnum.GUILD_CREATE_ERROR_EMBLEM_ALREADY_EXISTS); } GuildRecord record = GuildRecord.New(name, contextEmblem, DEFAULT_MAX_TAX_COLLECTOR); record.AddElement(); GuildInstance instance = new GuildInstance(record); instance.Join(owner, true); Guilds.Add(instance); return(GuildCreationResultEnum.GUILD_CREATE_OK); }
/// <summary> /// /// </summary> /// <param name="instance"></param> private void AddInstance(GuildInstance instance) { WorldService.Instance.AddUpdatable(instance); m_guildById.Add(instance.Id, instance); m_guildByName.Add(instance.Name.ToLower(), instance); }
/// <summary> /// /// </summary> /// <param name="guild"></param> public void Destroy(GuildInstance guild) { m_guildById.Remove(guild.Id); m_guildByName.Remove(guild.Name.ToLower()); }
public void RemoveGuild(GuildInstance guildInstance) { Guilds.Remove(guildInstance); guildInstance.Record.RemoveElement(); }