Esempio n. 1
0
        public static Clan CreateClan(Clan clan)
        {
            clan.Clan_ID = AllianceSeed++;

            DatabaseManager.CreateAlliance(clan);

            ResourcesManager.AddAllianceInMemory(clan);
            return(clan);
        }
Esempio n. 2
0
        public static Clan CreateClan()
        {
            var alliance = default(Clan);

            alliance = new Clan(AllianceSeed++);

            DatabaseManager.CreateAlliance(alliance);

            ResourcesManager.AddAllianceInMemory(alliance);
            return(alliance);
        }
Esempio n. 3
0
        public static Clan GetAlliance(long allianceId)
        {
            var alliance = default(Clan);

            // Try to get alliance from memory first then db.
            // Could be improved.
            if (ResourcesManager.InMemoryAlliancesContain(allianceId))
            {
                return(ResourcesManager.GetInMemoryAlliance(allianceId));
            }

            alliance = DatabaseManager.GetClan(allianceId);

            if (alliance != null)
            {
                ResourcesManager.AddAllianceInMemory(alliance);
            }

            return(alliance);
        }