Beispiel #1
0
        public static Data_Class read(BinaryReader reader)
        {
            Data_Class result = new Data_Class();

            result.Id   = reader.ReadInt32();
            result.Name = reader.ReadString();
            result.Class_Types.read(reader);
            result.Skills.read(reader);
            result.Description = reader.ReadString();
            bool own_caps = reader.ReadBoolean();

            if (own_caps)
            {
                result.Caps = result.Caps.read(reader);
            }
            else
            {
                result.Caps = null;
            }
            result.Max_WLvl.read(reader);
            result.Promotion.read(reader);
            result.Tier          = reader.ReadInt32();
            result.Mov           = reader.ReadInt32();
            result.Mov_Cap       = reader.ReadInt32();
            result.Movement_Type = (MovementTypes)reader.ReadInt32();
            result.Generic_Stats.read(reader);
            return(result);
        }
Beispiel #2
0
 public Data_Class(Data_Class data)
 {
     Id          = data.Id;
     Name        = data.Name;
     Class_Types = new List <ClassTypes>(data.Class_Types);
     Skills      = new List <Data_Class_Skill>(data.Skills);
     Description = data.Description;
     if (data.Caps == null)
     {
         Caps = null;
     }
     else
     {
         Caps = new List <int> [data.Caps.Length];
         for (int i = 0; i < Caps.Length; i++)
         {
             Caps[i] = new List <int>(data.Caps[i]);
         }
     }
     Max_WLvl  = new List <int>(data.Max_WLvl);
     Promotion = new Dictionary <int, List <int>[]>();
     foreach (KeyValuePair <int, List <int>[]> pair in data.Promotion)
     {
         Promotion.Add(pair.Key, new List <int> [pair.Value.Length]);
         for (int i = 0; i < pair.Value.Length; i++)
         {
             Promotion[pair.Key][i] = new List <int>(pair.Value[i]);
         }
     }
     Tier          = data.Tier;
     Mov           = data.Mov;
     Mov_Cap       = data.Mov_Cap;
     Movement_Type = data.Movement_Type;
     Generic_Stats = new List <List <int>[]>();
     foreach (List <int>[] stats in data.Generic_Stats)
     {
         Generic_Stats.Add(new List <int> [stats.Length]);
         for (int i = 0; i < stats.Length; i++)
         {
             Generic_Stats[Generic_Stats.Count - 1][i] = new List <int>(stats[i]);
         }
     }
 }