コード例 #1
0
        public static void Init()
        {
            if (inited)
            {
                return;
            }
            inited = true;
            BSD[0] = new BSD0();
            for (int i = 1; i < 256; i++)
            {
                BSD[i] = BSD[0];
            }
            Register(0, new BSD0(), "default", "block", "standard", "cube", "plain");
            BSD[1]  = new BSD01_5(0.84f);
            BSD[2]  = new BSD01_5(0.68f);
            BSD[3]  = new BSD01_5(0.50f);
            BSD[4]  = new BSD01_5(0.34f);
            BSD[5]  = new BSD01_5(0.13f);
            BSD[6]  = new BSD06_10(0.84f);
            BSD[7]  = new BSD06_10(0.68f);
            BSD[8]  = new BSD06_10(0.50f);
            BSD[9]  = new BSD06_10(0.34f);
            BSD[10] = new BSD06_10(0.13f);
            BSD[11] = new BSD11_15(0.84f);
            BSD[12] = new BSD11_15(0.68f);
            BSD[13] = new BSD11_15(0.50f);
            BSD[14] = new BSD11_15(0.34f);
            BSD[15] = new BSD11_15(0.13f);
            BSD[16] = new BSD16_20(0.84f);
            BSD[17] = new BSD16_20(0.68f);
            BSD[18] = new BSD16_20(0.50f);
            BSD[19] = new BSD16_20(0.34f);
            BSD[20] = new BSD16_20(0.13f);
            BSD[21] = new BSD21_25(0.84f);
            BSD[22] = new BSD21_25(0.68f);
            BSD[23] = new BSD21_25(0.50f);
            BSD[24] = new BSD21_25(0.34f);
            BSD[25] = new BSD21_25(0.13f);
            BSD[26] = new BSD26_30(0.84f);
            BSD[27] = new BSD26_30(0.68f);
            BSD[28] = new BSD26_30(0.50f);
            BSD[29] = new BSD26_30(0.34f);
            BSD[30] = new BSD26_30(0.13f);
            BSD[31] = new BSD31();
            BSD[32] = new BSD32();
            BSD[33] = new BSD33();
            BSD[34] = new BSD34();
            // ...
            BSD[39] = new BSD39a76(1f);
            // ...
            BSD[52] = new BSD52a127(0.25f, 0.75f, 0.5f);
            BSD[53] = new BSD53_54(0.25f, 0.75f, 0.5f);
            BSD[54] = new BSD53_54(0f, 1f, 1f);
            BSD[55] = new BSD55();
            BSD[56] = new BSD56();
            BSD[57] = new BSD57();
            BSD[58] = new BSD58();
            // ...
            BSD[64] = new BSD64_68(MaterialSide.BOTTOM, MaterialSide.XP, MaterialSide.XM, MaterialSide.YP, MaterialSide.YM, MaterialSide.TOP);
            BSD[65] = new BSD64_68(MaterialSide.XP, MaterialSide.XM, MaterialSide.YP, MaterialSide.YM, MaterialSide.TOP, MaterialSide.BOTTOM);
            BSD[66] = new BSD64_68(MaterialSide.XM, MaterialSide.YP, MaterialSide.YM, MaterialSide.TOP, MaterialSide.BOTTOM, MaterialSide.XP);
            BSD[67] = new BSD64_68(MaterialSide.YP, MaterialSide.YM, MaterialSide.TOP, MaterialSide.BOTTOM, MaterialSide.XP, MaterialSide.XM);
            BSD[68] = new BSD64_68(MaterialSide.YM, MaterialSide.TOP, MaterialSide.BOTTOM, MaterialSide.XP, MaterialSide.XM, MaterialSide.YP);
            // ...
            BSD[72] = new BSD72();
            BSD[73] = new BSD73();
            BSD[74] = new BSD74();
            BSD[75] = new BSD75();
            BSD[76] = new BSD39a76(0.5f);
            // ...
            BSD[80] = new BSD80();
            BSD[81] = new BSD81();
            BSD[82] = new BSD82();
            BSD[83] = new BSD83();
            // ...
            BSD[127] = new BSD52a127(0f, 1f, 1f);
            // ...
            // Final setup
            int[][] DB_TID = MaterialHelpers.ALL_MATS[(int)Material.DEBUG].TID;
            int     lim    = 0;

            for (int i = 0; i < DB_TID.Length; i++)
            {
                for (int x = 0; x < (DB_TID[i]).Length; x++)
                {
                    if ((DB_TID[i])[x] > lim)
                    {
                        lim = (DB_TID[i])[x];
                    }
                }
            }
            int[] rlok = new int[lim + 1];
            for (int i = 0; i < DB_TID.Length; i++)
            {
                for (int x = 0; x < (DB_TID[i]).Length; x++)
                {
                    rlok[(DB_TID[i])[x]] = i;
                }
            }
            for (int i = 0; i < 256; i++)
            {
                if (i > 0 && BSD[i] == BSD[0])
                {
                    continue;
                }
                BSD[i].Preparse(rlok);
            }
        }
コード例 #2
0
 public static void Init()
 {
     if (inited)
     {
         return;
     }
     inited = true;
     for (int i = 0; i < 256; i++)
     {
         BSD[i] = new BSD0();
     }
     Register(0, new BSD0(), "default", "block", "standard", "cube", "plain");
     BSD[1]  = new BSD01_5(0.84f);
     BSD[2]  = new BSD01_5(0.68f);
     BSD[3]  = new BSD01_5(0.50f);
     BSD[4]  = new BSD01_5(0.34f);
     BSD[5]  = new BSD01_5(0.13f);
     BSD[6]  = new BSD06_10(0.84f);
     BSD[7]  = new BSD06_10(0.68f);
     BSD[8]  = new BSD06_10(0.50f);
     BSD[9]  = new BSD06_10(0.34f);
     BSD[10] = new BSD06_10(0.13f);
     BSD[11] = new BSD11_15(0.84f);
     BSD[12] = new BSD11_15(0.68f);
     BSD[13] = new BSD11_15(0.50f);
     BSD[14] = new BSD11_15(0.34f);
     BSD[15] = new BSD11_15(0.13f);
     BSD[16] = new BSD16_20(0.84f);
     BSD[17] = new BSD16_20(0.68f);
     BSD[18] = new BSD16_20(0.50f);
     BSD[19] = new BSD16_20(0.34f);
     BSD[20] = new BSD16_20(0.13f);
     BSD[21] = new BSD21_25(0.84f);
     BSD[22] = new BSD21_25(0.68f);
     BSD[23] = new BSD21_25(0.50f);
     BSD[24] = new BSD21_25(0.34f);
     BSD[25] = new BSD21_25(0.13f);
     BSD[26] = new BSD26_30(0.84f);
     BSD[27] = new BSD26_30(0.68f);
     BSD[28] = new BSD26_30(0.50f);
     BSD[29] = new BSD26_30(0.34f);
     BSD[30] = new BSD26_30(0.13f);
     BSD[31] = new BSD31();
     BSD[32] = new BSD32();
     BSD[33] = new BSD33();
     BSD[34] = new BSD34();
     // ...
     BSD[39] = new BSD39a76(1f);
     // ...
     BSD[52] = new BSD52a127(0.25f, 0.75f, 0.5f);
     BSD[53] = new BSD53_54(0.25f, 0.75f, 0.5f);
     BSD[54] = new BSD53_54(0f, 1f, 1f);
     BSD[55] = new BSD55();
     BSD[56] = new BSD56();
     BSD[57] = new BSD57();
     BSD[58] = new BSD58();
     // ...
     BSD[64] = new BSD64_68(MaterialSide.BOTTOM, MaterialSide.XP, MaterialSide.XM, MaterialSide.YP, MaterialSide.YM, MaterialSide.TOP);
     BSD[65] = new BSD64_68(MaterialSide.XP, MaterialSide.XM, MaterialSide.YP, MaterialSide.YM, MaterialSide.TOP, MaterialSide.BOTTOM);
     BSD[66] = new BSD64_68(MaterialSide.XM, MaterialSide.YP, MaterialSide.YM, MaterialSide.TOP, MaterialSide.BOTTOM, MaterialSide.XP);
     BSD[67] = new BSD64_68(MaterialSide.YP, MaterialSide.YM, MaterialSide.TOP, MaterialSide.BOTTOM, MaterialSide.XP, MaterialSide.XM);
     BSD[68] = new BSD64_68(MaterialSide.YM, MaterialSide.TOP, MaterialSide.BOTTOM, MaterialSide.XP, MaterialSide.XM, MaterialSide.YP);
     // ...
     BSD[72] = new BSD72();
     BSD[73] = new BSD73();
     BSD[74] = new BSD74();
     BSD[75] = new BSD75();
     BSD[76] = new BSD39a76(0.5f);
     // ...
     BSD[80] = new BSD80();
     BSD[81] = new BSD81();
     BSD[82] = new BSD82();
     BSD[83] = new BSD83();
     // ...
     BSD[127] = new BSD52a127(0f, 1f, 1f);
     // ...
     // Final setup
     for (int i = 0; i < 256; i++)
     {
         if (i > 0 && BSD[i] is BSD0)
         {
             continue;
         }
         BSD[i].Preparse();
     }
 }