Bitmap Get_Row_Image(Block b) { Bitmap bac; BITMAP.New(out bac,LAYOUT_RECT.Size.Width, BLOCK_SIZE.Height, Color.FromArgb(0, 0, 0, 0)); BitmapData data_bac = bac.GetBitmapData(); Draw_Block(b, data_bac); Default.COLOR = Color.FromArgb(255, 255, 255); Draw_Info(b, data_bac); Default.Unlock.COLOR(); bac.UnlockBits(data_bac); return bac; }
static void Draw_Info(Block b, BitmapData data_bac) { int column = 125; PointD p = new PointD(BLOCK_SIZE.Width, 0); data_bac.Paste(b.NAME, p, Color.Yellow); p.X += column; data_bac.Paste("$" + b.PRICE.ToString(), p); p.X += column; int v = OreStorage.Get(b.NAME); data_bac.Paste(v.ToString() + (v == 1 ? " pc" : " pcs"), p); p.X += column; data_bac.Paste("$" + (b.PRICE * v).ToString(), p); }
public static void DigStart(Directions direction) { Point p = Pod_Frame.Pod.AT_BLOCK; IS_DIGGING = true; DIG_DIRECTION = direction; PROGRESS = 100.0; switch (direction) { case Directions.Down: p.Y++; break; case Directions.Left: p.X--; break; case Directions.Right: p.X++; break; default: throw new ArgumentException("Can't handle the \"direction\" parameter"); } BLOCK_DIGGING = Get_Block(p); BLOCK_DIGGING.X = p.X; BLOCK_DIGGING.Y = p.Y; double period = PROGRESS / DIG_SPEED / CONST.UpdateFrequency; if (period > 1.0) { SPEED_UP_RATIO = period / (1.0 * Math.Pow(period / 1.0, 0.25)); string s = "↑Speed Up " + (SPEED_UP_RATIO * 100.0).ToString("F2") + "%↑"; PodMessage.Add(s, Color.FromArgb(255, 255, 0), null); } else SPEED_UP_RATIO = 1.0; DIG_TIMES_REMAIN = 0.0; Sound.Begin("Drill"); }
static void Draw_Block(Block b,BitmapData data_bac) { Bitmap bmp = b.BMP_DATA.Resize(BLOCK_SIZE); data_bac.Paste(bmp, new Point(0, 0),ImagePasteMode.Overwrite); }
public static void InitialComponents() { OBJECTS = new HashSet<Objects>(); MAP = new string[Width, Height]; DataBase.InitialComponents(); int idx = 0; Ground = new Block(DataBase.Names[idx], DataBase.Drillables[idx], DataBase.Prices[idx], DataBase.Hardnesses[idx], DataBase.Distributes[idx]); idx++; Rock = new Block(DataBase.Names[idx], DataBase.Drillables[idx], DataBase.Prices[idx], DataBase.Hardnesses[idx], DataBase.Distributes[idx]); idx++; Soil = new Block(DataBase.Names[idx], DataBase.Drillables[idx], DataBase.Prices[idx], DataBase.Hardnesses[idx], DataBase.Distributes[idx]); idx++; Coal = new Block(DataBase.Names[idx], DataBase.Drillables[idx], DataBase.Prices[idx], DataBase.Hardnesses[idx], DataBase.Distributes[idx]); idx++; Sulfur = new Block(DataBase.Names[idx], DataBase.Drillables[idx], DataBase.Prices[idx], DataBase.Hardnesses[idx], DataBase.Distributes[idx]); idx++; Copper = new Block(DataBase.Names[idx], DataBase.Drillables[idx], DataBase.Prices[idx], DataBase.Hardnesses[idx], DataBase.Distributes[idx]); idx++; Iron = new Block(DataBase.Names[idx], DataBase.Drillables[idx], DataBase.Prices[idx], DataBase.Hardnesses[idx], DataBase.Distributes[idx]); idx++; Crystal = new Block(DataBase.Names[idx], DataBase.Drillables[idx], DataBase.Prices[idx], DataBase.Hardnesses[idx], DataBase.Distributes[idx]); idx++; Jadeite = new Block(DataBase.Names[idx], DataBase.Drillables[idx], DataBase.Prices[idx], DataBase.Hardnesses[idx], DataBase.Distributes[idx]); idx++; Silver = new Block(DataBase.Names[idx], DataBase.Drillables[idx], DataBase.Prices[idx], DataBase.Hardnesses[idx], DataBase.Distributes[idx]); idx++; Gold = new Block(DataBase.Names[idx], DataBase.Drillables[idx], DataBase.Prices[idx], DataBase.Hardnesses[idx], DataBase.Distributes[idx]); idx++; Emerald = new Block(DataBase.Names[idx], DataBase.Drillables[idx], DataBase.Prices[idx], DataBase.Hardnesses[idx], DataBase.Distributes[idx]); idx++; Ruby = new Block(DataBase.Names[idx], DataBase.Drillables[idx], DataBase.Prices[idx], DataBase.Hardnesses[idx], DataBase.Distributes[idx]); idx++; Sapphire = new Block(DataBase.Names[idx], DataBase.Drillables[idx], DataBase.Prices[idx], DataBase.Hardnesses[idx], DataBase.Distributes[idx]); idx++; Diamond = new Block(DataBase.Names[idx], DataBase.Drillables[idx], DataBase.Prices[idx], DataBase.Hardnesses[idx], DataBase.Distributes[idx]); idx++; Lava = new Block(DataBase.Names[idx], DataBase.Drillables[idx], DataBase.Prices[idx], DataBase.Hardnesses[idx], DataBase.Distributes[idx]); idx++; Build_MAP(); }