예제 #1
0
        public bool CreateGuild(string name, string notice, Character leader)
        {
            DateTime now     = DateTime.Now;
            TGuild   dbGuild = DBService.Instance.Entities.Guilds.Create();

            dbGuild.Name       = name;
            dbGuild.Notice     = notice;
            dbGuild.LeaderID   = leader.Id;
            dbGuild.LeaderName = leader.Name;
            dbGuild.CreateTime = now;
            DBService.Instance.Entities.Guilds.Add(dbGuild);

            Guild guild = new Guild(dbGuild);

            guild.AddMember(leader.Id, leader.Name, leader.Data.Class, leader.Data.Level, GuildTitle.President);
            leader.Guild = guild;
            DBService.Instance.Save();
            leader.Data.GuildId = dbGuild.Id;
            DBService.Instance.Save();
            this.AddGuild(guild);

            return(true);
        }
예제 #2
0
파일: Guild.cs 프로젝트: Lenzan/newmmo
 public Guild(TGuild guild)
 {
     this.Data = guild;
 }