Ejemplo n.º 1
0
 Block(string name, bool drillable, int price, double hardness, Normal_Distribute distribute, int x = -1, int y = -1)
 {
     NAME = name;
     PRICE = price;
     DRILLABLE = drillable;
     HARDNESS = hardness;
     DISTRIBUTE = distribute;
     BMP = BITMAP.FromFile(@"Picture\Block\" + NAME + ".png");
     BMP_DATA = BMP.GetBitmapData();
     if (BMP.Size != Size) { throw new ArgumentException("Size of Block's Image must be " + Size.ToString()); }
     X = x;
     Y = y;
 }
Ejemplo n.º 2
0
 public static void InitialComponents()
 {
     Names = new string[Length]
     {
         Things.Ground,
         Things.Rock,
         Things.Soil,
         Things.Coal,
         Things.Sulfur,
         Things.Copper,
         Things.Iron,
         Things.Crystal,
         Things.Jadeite,
         Things.Silver,
         Things.Gold,
         Things.Emerald,
         Things.Ruby,
         Things.Sapphire,
         Things.Diamond,
         Things.Lava
     };
     Drillables = new bool[Length]
     {
         false,
         true,
         true,
         true,
         true,
         true,
         true,
         true,
         true,
         true,
         true,
         true,
         true,
         true,
         true,
         true
     };
     Prices = new int[Length]
     {
         0,
         0,
         0,
         10,
         30,
         100,
         300,
         1000,
         3000,
         10000,
         30000,
         100000,
         300000,
         1000000,
         10000000,
         0
     };
     Hardnesses = new double[Length];
     Hardnesses[0] = -1.0;
     Hardnesses[1] = 50000.0;
     for (int i = 2; i < Length; i++)
         Hardnesses[i] = Math.Pow(i - 2, 4.0);
     Range = new Point(0, Height);
     Distributes = new Normal_Distribute[Length]
     {
         new Normal_Distribute(Range,Height, 0.50, 0.00, 0),
         new Normal_Distribute(Range,Height, 1.00, 0.20, 500.0),
         new Normal_Distribute(Range,Height, 0.50, 1000000.0, 2000.0),
         new Normal_Distribute(Range,Height, 0.20, 0.20, 500.0),
         new Normal_Distribute(Range,Height, 0.30, 0.18, 400.0),
         new Normal_Distribute(Range,Height, 0.40, 0.16, 350.0),
         new Normal_Distribute(Range,Height, 0.50, 0.14, 300.0),
         new Normal_Distribute(Range,Height, 0.60, 0.12, 250.0),
         new Normal_Distribute(Range,Height, 0.70, 0.10, 200.0),
         new Normal_Distribute(Range,Height, 0.75, 0.09, 150.0),
         new Normal_Distribute(Range,Height, 0.80, 0.08, 100.0),
         new Normal_Distribute(Range,Height, 0.85, 0.07, 70.0),
         new Normal_Distribute(Range,Height, 0.90, 0.06, 50.0),
         new Normal_Distribute(Range,Height, 0.95, 0.05, 35.0),
         new Normal_Distribute(Range,Height, 1.00, 0.04, 20.0),
         new Normal_Distribute(Range,Height, 1.00, 0.15, 500.0)
     };
 }