コード例 #1
0
        public void UpdateFromModel(GuildInfo Model, bool RaiseChangedEvent)
        {
            if (RaiseChangedEvent)
            {
                GuildName       = Model.GuildName;
                PasswordSetFlag = Model.PasswordSetFlag;
                ChestPassword   = Model.ChestPassword;
                Flags           = Model.Flags;
                GuildID         = Model.GuildID;
                Rank1Male       = Model.Rank1Male;
                Rank1Female     = Model.Rank1Female;
                Rank2Male       = Model.Rank2Male;
                Rank2Female     = Model.Rank2Female;
                Rank3Male       = Model.Rank3Male;
                Rank3Female     = Model.Rank3Female;
                Rank4Male       = Model.Rank4Male;
                Rank4Female     = Model.Rank4Female;
                Rank5Male       = Model.Rank5Male;
                Rank5Female     = Model.Rank5Female;
                SupportedMember = Model.SupportedMember;

                GuildMembers.Clear();
                foreach (GuildMemberEntry obj in Model.GuildMembers)
                {
                    GuildMembers.Add(obj);
                }

                // not isvisible
            }
            else
            {
                guildName       = Model.GuildName;
                passwordSetFlag = Model.PasswordSetFlag;
                chestPassword   = Model.ChestPassword;
                flags           = Model.Flags;
                guildID         = Model.GuildID;
                rank1Male       = Model.Rank1Male;
                rank1Female     = Model.Rank1Female;
                rank2Male       = Model.Rank2Male;
                rank2Female     = Model.Rank2Female;
                rank3Male       = Model.Rank3Male;
                rank3Female     = Model.Rank3Female;
                rank4Male       = Model.Rank4Male;
                rank4Female     = Model.Rank4Female;
                rank5Male       = Model.Rank5Male;
                rank5Female     = Model.Rank5Female;
                supportedMember = Model.SupportedMember;

                guildMembers.Clear();
                foreach (GuildMemberEntry obj in Model.GuildMembers)
                {
                    guildMembers.Add(obj);
                }

                // not isvisible
            }
        }
コード例 #2
0
 public void Clear(bool RaiseChangedEvent)
 {
     if (RaiseChangedEvent)
     {
         GuildName       = String.Empty;
         PasswordSetFlag = 0;
         ChestPassword   = String.Empty;
         Flags           = new GuildFlags();
         GuildID         = new ObjectID(0);
         Rank1Male       = String.Empty;
         Rank1Female     = String.Empty;
         Rank2Male       = String.Empty;
         Rank2Female     = String.Empty;
         Rank3Male       = String.Empty;
         Rank3Female     = String.Empty;
         Rank4Male       = String.Empty;
         Rank4Female     = String.Empty;
         Rank5Male       = String.Empty;
         Rank5Female     = String.Empty;
         SupportedMember = new ObjectID(0);
         GuildMembers.Clear();
         IsVisible = false;
     }
     else
     {
         guildName       = String.Empty;
         passwordSetFlag = 0;
         chestPassword   = String.Empty;
         flags           = new GuildFlags();
         guildID         = new ObjectID(0);
         rank1Male       = String.Empty;
         rank1Female     = String.Empty;
         rank2Male       = String.Empty;
         rank2Female     = String.Empty;
         rank3Male       = String.Empty;
         rank3Female     = String.Empty;
         rank4Male       = String.Empty;
         rank4Female     = String.Empty;
         rank5Male       = String.Empty;
         rank5Female     = String.Empty;
         supportedMember = new ObjectID(0);
         guildMembers.Clear();
         isVisible = false;
     }
 }
コード例 #3
0
 public GuildInfo(string GuildName, byte PasswordSetFlag, string ChestPassword, GuildFlags Flags, ObjectID GuildID,
                  string Rank1Male, string Rank1Female, string Rank2Male, string Rank2Female, string Rank3Male, string Rank3Female,
                  string Rank4Male, string Rank4Female, string Rank5Male, string Rank5Female,
                  ObjectID SupportedMember, GuildMemberList GuildMembers)
 {
     this.guildName       = GuildName;
     this.passwordSetFlag = PasswordSetFlag;
     this.chestPassword   = ChestPassword;
     this.flags           = Flags;
     this.guildID         = GuildID;
     this.rank1Male       = Rank1Male;
     this.rank1Female     = Rank1Female;
     this.rank2Male       = Rank2Male;
     this.rank2Female     = Rank2Female;
     this.rank3Male       = Rank3Male;
     this.rank3Female     = Rank3Female;
     this.rank4Male       = Rank4Male;
     this.rank4Female     = Rank4Female;
     this.rank5Male       = Rank5Male;
     this.rank5Female     = Rank5Female;
     this.supportedMember = SupportedMember;
     this.guildMembers    = GuildMembers;
 }
コード例 #4
0
ファイル: GuildInfo.cs プロジェクト: GJiin/meridian59-dotnet
        /// <summary>
        /// Constructor by values
        /// </summary>
        /// <param name="GuildName"></param>
        /// <param name="PasswordSetFlag"></param>
        /// <param name="ChestPassword"></param>
        /// <param name="Flags"></param>
        /// <param name="GuildID"></param>
        /// <param name="Rank1Male"></param>
        /// <param name="Rank1Female"></param>
        /// <param name="Rank2Male"></param>
        /// <param name="Rank2Female"></param>
        /// <param name="Rank3Male"></param>
        /// <param name="Rank3Female"></param>
        /// <param name="Rank4Male"></param>
        /// <param name="Rank4Female"></param>
        /// <param name="Rank5Male"></param>
        /// <param name="Rank5Female"></param>
        /// <param name="SupportedMember"></param>
        /// <param name="GuildMembers"></param>
        public GuildInfo(string GuildName, byte PasswordSetFlag, string ChestPassword, GuildFlags Flags, ObjectID GuildID,
                         string Rank1Male, string Rank1Female, string Rank2Male, string Rank2Female, string Rank3Male, string Rank3Female,
                         string Rank4Male, string Rank4Female, string Rank5Male, string Rank5Female,
                         ObjectID SupportedMember, IEnumerable <GuildMemberEntry> GuildMembers)
        {
            guildName       = GuildName;
            passwordSetFlag = PasswordSetFlag;
            chestPassword   = ChestPassword;
            flags           = Flags;
            guildID         = GuildID;
            rank1Male       = Rank1Male;
            rank1Female     = Rank1Female;
            rank2Male       = Rank2Male;
            rank2Female     = Rank2Female;
            rank3Male       = Rank3Male;
            rank3Female     = Rank3Female;
            rank4Male       = Rank4Male;
            rank4Female     = Rank4Female;
            rank5Male       = Rank5Male;
            rank5Female     = Rank5Female;
            supportedMember = SupportedMember;

            guildMembers.AddRange(GuildMembers);
        }
コード例 #5
0
        public unsafe void ReadFrom(ref byte *Buffer)
        {
            ushort len = *((ushort *)Buffer);

            Buffer += TypeSizes.SHORT;

            guildName = new string((sbyte *)Buffer, 0, len);
            Buffer   += len;

            passwordSetFlag = Buffer[0];
            Buffer++;

            if (passwordSetFlag == 0x01)
            {
                len     = *((ushort *)Buffer);
                Buffer += TypeSizes.SHORT;

                chestPassword = new string((sbyte *)Buffer, 0, len);
                Buffer       += len;
            }

            flags   = new GuildFlags(*((uint *)Buffer));
            Buffer += TypeSizes.INT;

            guildID = new ObjectID(ref Buffer);

            len     = *((ushort *)Buffer);
            Buffer += TypeSizes.SHORT;

            rank1Male = new string((sbyte *)Buffer, 0, len);
            Buffer   += len;

            len     = *((ushort *)Buffer);
            Buffer += TypeSizes.SHORT;

            rank1Female = new string((sbyte *)Buffer, 0, len);
            Buffer     += len;

            len     = *((ushort *)Buffer);
            Buffer += TypeSizes.SHORT;

            rank2Male = new string((sbyte *)Buffer, 0, len);
            Buffer   += len;

            len     = *((ushort *)Buffer);
            Buffer += TypeSizes.SHORT;

            rank2Female = new string((sbyte *)Buffer, 0, len);
            Buffer     += len;

            len     = *((ushort *)Buffer);
            Buffer += TypeSizes.SHORT;

            rank3Male = new string((sbyte *)Buffer, 0, len);
            Buffer   += len;

            len     = *((ushort *)Buffer);
            Buffer += TypeSizes.SHORT;

            rank3Female = new string((sbyte *)Buffer, 0, len);
            Buffer     += len;

            len     = *((ushort *)Buffer);
            Buffer += TypeSizes.SHORT;

            rank4Male = new string((sbyte *)Buffer, 0, len);
            Buffer   += len;

            len     = *((ushort *)Buffer);
            Buffer += TypeSizes.SHORT;

            rank4Female = new string((sbyte *)Buffer, 0, len);
            Buffer     += len;

            len     = *((ushort *)Buffer);
            Buffer += TypeSizes.SHORT;

            rank5Male = new string((sbyte *)Buffer, 0, len);
            Buffer   += len;

            len     = *((ushort *)Buffer);
            Buffer += TypeSizes.SHORT;

            rank5Female = new string((sbyte *)Buffer, 0, len);
            Buffer     += len;

            supportedMember = new ObjectID(ref Buffer);

            len     = *((ushort *)Buffer);
            Buffer += TypeSizes.SHORT;

            guildMembers = new GuildMemberList(len);
            for (ushort i = 0; i < len; i++)
            {
                guildMembers.Add(new GuildMemberEntry(ref Buffer));
            }
        }
コード例 #6
0
        public int ReadFrom(byte[] Buffer, int StartIndex = 0)
        {
            int cursor = StartIndex;

            ushort len = BitConverter.ToUInt16(Buffer, cursor);                 // NameLEN  (2 bytes)

            cursor += TypeSizes.SHORT;

            guildName = Encoding.Default.GetString(Buffer, cursor, len);        // Name     (n bytes)
            cursor   += len;

            passwordSetFlag = Buffer[cursor];                                   // PasswordSetFlag (1 byte)
            cursor++;

            if (passwordSetFlag == 0x01)
            {
                len     = BitConverter.ToUInt16(Buffer, cursor);                 // PasswordLEN  (2 bytes)
                cursor += TypeSizes.SHORT;

                chestPassword = Encoding.Default.GetString(Buffer, cursor, len); // Password     (n bytes)
                cursor       += len;
            }

            flags   = new GuildFlags(BitConverter.ToUInt32(Buffer, cursor));     // Flags (4 bytes)
            cursor += TypeSizes.INT;

            guildID = new ObjectID(Buffer, cursor);                             // ID       (4/8 bytes)
            cursor += guildID.ByteLength;

            len     = BitConverter.ToUInt16(Buffer, cursor);                    // Rank1MaleLEN (2 bytes)
            cursor += TypeSizes.SHORT;

            rank1Male = Encoding.Default.GetString(Buffer, cursor, len);        // Rank1Male    (n bytes)
            cursor   += len;

            len     = BitConverter.ToUInt16(Buffer, cursor);                    // Rank1FemaleLEN (2 bytes)
            cursor += TypeSizes.SHORT;

            rank1Female = Encoding.Default.GetString(Buffer, cursor, len);      // Rank1Female    (n bytes)
            cursor     += len;

            len     = BitConverter.ToUInt16(Buffer, cursor);                    // Rank2MaleLEN (2 bytes)
            cursor += TypeSizes.SHORT;

            rank2Male = Encoding.Default.GetString(Buffer, cursor, len);        // Rank2Male    (n bytes)
            cursor   += len;

            len     = BitConverter.ToUInt16(Buffer, cursor);                    // Rank2FemaleLEN (2 bytes)
            cursor += TypeSizes.SHORT;

            rank2Female = Encoding.Default.GetString(Buffer, cursor, len);      // Rank2Female    (n bytes)
            cursor     += len;

            len     = BitConverter.ToUInt16(Buffer, cursor);                    // Rank3MaleLEN (2 bytes)
            cursor += TypeSizes.SHORT;

            rank3Male = Encoding.Default.GetString(Buffer, cursor, len);        // Rank3Male    (n bytes)
            cursor   += len;

            len     = BitConverter.ToUInt16(Buffer, cursor);                    // Rank3FemaleLEN (2 bytes)
            cursor += TypeSizes.SHORT;

            rank3Female = Encoding.Default.GetString(Buffer, cursor, len);      // Rank3Female    (n bytes)
            cursor     += len;

            len     = BitConverter.ToUInt16(Buffer, cursor);                    // Rank4MaleLEN (2 bytes)
            cursor += TypeSizes.SHORT;

            rank4Male = Encoding.Default.GetString(Buffer, cursor, len);        // Rank4Male    (n bytes)
            cursor   += len;

            len     = BitConverter.ToUInt16(Buffer, cursor);                    // Rank4FemaleLEN (2 bytes)
            cursor += TypeSizes.SHORT;

            rank4Female = Encoding.Default.GetString(Buffer, cursor, len);      // Rank4Female    (n bytes)
            cursor     += len;

            len     = BitConverter.ToUInt16(Buffer, cursor);                    // Rank5MaleLEN (2 bytes)
            cursor += TypeSizes.SHORT;

            rank5Male = Encoding.Default.GetString(Buffer, cursor, len);        // Rank5Male    (n bytes)
            cursor   += len;

            len     = BitConverter.ToUInt16(Buffer, cursor);                    // Rank5FemaleLEN (2 bytes)
            cursor += TypeSizes.SHORT;

            rank5Female = Encoding.Default.GetString(Buffer, cursor, len);      // Rank5Female    (n bytes)
            cursor     += len;

            supportedMember = new ObjectID(Buffer, cursor);                     // SupportedMember(4/8 bytes)
            cursor         += supportedMember.ByteLength;

            len     = BitConverter.ToUInt16(Buffer, cursor);                    // ListLEN
            cursor += TypeSizes.SHORT;

            guildMembers = new GuildMemberList(len);
            for (ushort i = 0; i < len; i++)
            {
                GuildMemberEntry obj = new GuildMemberEntry(Buffer, cursor);    // GuildMemberEntry (n bytes)
                guildMembers.Add(obj);
                cursor += obj.ByteLength;
            }

            return(ByteLength);
        }