예제 #1
0
 private void M2TWHandleStatPri(ref M2StatWeapons stat_pri, string[] data)
 {
     if (data.Count() == 11)
     {
         LookUpTables lu = new LookUpTables();
         stat_pri.atk[0]      = Convert.ToInt32(data[0].Trim());
         stat_pri.atk[1]      = Convert.ToInt32(data[1].Trim());
         stat_pri.missAttr[0] = Convert.ToInt32(data[3].Trim());
         stat_pri.missAttr[1] = Convert.ToInt32(data[4].Trim());
         stat_pri.missType    = data[2].Trim();
         stat_pri.WepFlags    = lu.LookUpKey <WeaponType>(data[5].Trim());
         stat_pri.TechFlags   = (TechType)Enum.Parse(typeof(TechType), data[6].Trim());
         stat_pri.DmgFlags    = lu.LookUpKey <DamageType>(data[7].Trim());
         stat_pri.SoundFlags  = data[8].Trim();
         stat_pri.atkDly[0]   = Convert.ToInt32(data[9].Trim());
         stat_pri.atkDly[1]   = (float)Convert.ToDouble(data[10].Trim());
     }
     else if (data.Count() == 12)
     {
         LookUpTables lu = new LookUpTables();
         stat_pri.atk[0]          = Convert.ToInt32(data[0].Trim());
         stat_pri.atk[1]          = Convert.ToInt32(data[1].Trim());
         stat_pri.missAttr[0]     = Convert.ToInt32(data[3].Trim());
         stat_pri.missAttr[1]     = Convert.ToInt32(data[4].Trim());
         stat_pri.missType        = data[2].Trim();
         stat_pri.WepFlags        = lu.LookUpKey <WeaponType>(data[5].Trim());
         stat_pri.TechFlags       = (TechType)Enum.Parse(typeof(TechType), data[6].Trim());
         stat_pri.DmgFlags        = lu.LookUpKey <DamageType>(data[7].Trim());
         stat_pri.SoundFlags      = data[8].Trim();
         stat_pri.musket_shot_set = data[9].Trim();
         stat_pri.atkDly[0]       = Convert.ToInt32(data[10].Trim());
         stat_pri.atkDly[1]       = (float)Convert.ToDouble(data[11].Trim());
     }
 }
예제 #2
0
        private void HandleMental(ref Mentality mental, string[] data)
        {
            LookUpTables lookUp = new LookUpTables();

            mental.morale     = Convert.ToInt32(data[0].Trim());
            mental.discipline = lookUp.LookUpKey <Statmental_discipline>(data[1].Trim());
            mental.training   = lookUp.LookUpKey <Statmental_training>(data[2].Trim());
        }
예제 #3
0
        private void HandleStatPriArmour <T>(ref T statPriArmour, string[] data)
        {
            LookUpTables lookUp = new LookUpTables();

            if (statPriArmour is StatPriArmour)
            {
                ((StatPriArmour)(object)statPriArmour).priArm[0] = Convert.ToInt32(data[0].Trim());
                ((StatPriArmour)(object)statPriArmour).priArm[1] = Convert.ToInt32(data[1].Trim());
                ((StatPriArmour)(object)statPriArmour).priArm[2] = Convert.ToInt32(data[2].Trim());
                ((StatPriArmour)(object)statPriArmour).armSound  = lookUp.LookUpKey <ArmourSound>(data[3].Trim());
            }
            else if (statPriArmour is StatSecArmour)
            {
                ((StatSecArmour)(object)statPriArmour).secArmour[0] = Convert.ToInt32(data[0].Trim());
                ((StatSecArmour)(object)statPriArmour).secArmour[1] = Convert.ToInt32(data[1].Trim());
                ((StatSecArmour)(object)statPriArmour).secArmSound  = lookUp.LookUpKey <ArmourSound>(data[2].Trim());
            }
        }
예제 #4
0
        private void HandleStatPriAttr(ref Stat_pri_attr stat_Pri_, string[] data)
        {
            LookUpTables lu = new LookUpTables();

            Stat_pri_attr temp = Stat_pri_attr.no;

            stat_Pri_ = temp;

            if (data[0] == lu.LookUpString <Stat_pri_attr>(Stat_pri_attr.no))
            {
                return;
            }

            foreach (string str in data)
            {
                stat_Pri_ |= lu.LookUpKey <Stat_pri_attr>(str.Trim());
            }

            stat_Pri_ &= ~Stat_pri_attr.no;
        }
예제 #5
0
        private void HandleFormation(ref Formation formation, string[] data)
        {
            LookUpTables lookUp = new LookUpTables();


            int i = 0;
            int a = 0;
            int b = 0;

            foreach (string STRING in data)
            {
                if (i < 2)
                {
                    formation.FormationTight[i] = STRING.Trim().UniversalParse();
                }
                else if (a < 2)
                {
                    formation.FormationSparse[a] = STRING.Trim().UniversalParse();
                    a++;
                }
                else if (b < 1)
                {
                    formation.FormationRanks = Convert.ToInt32(STRING.Trim());
                    b++;
                }

                dynamic ft = lookUp.LookUpKey <FormationTypes>(STRING.Trim());

                if (ft != null)
                {
                    formation.FormationFlags |= ft;
                }

                i++;
            }
        }