private GuildContainer CreateGuildContainer(Guild guild, IGuildServerContext databaseContext) { var id = (uint)this.idGenerator.GetId(); var guildContainer = new GuildContainer(guild, id, databaseContext); this.guildDictionary.Add(id, guildContainer); this.guildIdMapping.Add(guild.Id, id); return(guildContainer); }
/// <summary> /// Initializes a new instance of the <see cref="GuildContainer" /> class. /// </summary> /// <param name="guild">The guild.</param> /// <param name="id">The short identifier.</param> /// <param name="databaseContext">The database context.</param> internal GuildContainer(DataModel.Entities.Guild guild, uint id, IGuildServerContext databaseContext) { this.DatabaseContext = databaseContext; this.Guild = guild; this.Id = id; this.Members = new SortedList <Guid, GuildListEntry>(); foreach (var member in this.Guild.Members) { // The player names are loaded separately, if required. this.Members.Add(member.Id, new GuildListEntry { PlayerName = null, ServerId = GuildServer.OfflineServerId, PlayerPosition = member.Status }); } }