public ResourcePicture() { this.DeepForestA1 = GetDerivationTable(this.Pic_DeepForestA1, 16, 12); this.DeepForestA2 = GetDerivationTable(this.Pic_DeepForestA2, 16, 12); this.DeepForestA5 = GetDerivationTable(this.Pic_DeepForestA5, 8, 16); this.DeepForestB = GetDerivationTable(this.Pic_DeepForestB, 16, 16); this.RuinF = GetDerivationTable(this.Pic_RuinF, 16, 16); this.LFCharaSogen01 = GetDerivationTable(this.Pic_LFCharaSogen01, 12, 8); }
private static DDTable <DDPicture> GetDerivationTable(DDPicture pic, int w, int h) { DDTable <DDPicture> table = new DDTable <DDPicture>(w, h); int dw = pic.Get_W() / w; int dh = pic.Get_H() / h; if (dw * w != pic.Get_W()) { throw new DDError(); // 2bs } if (dh * h != pic.Get_H()) { throw new DDError(); // 2bs } for (int x = 0; x < w; x++) { for (int y = 0; y < h; y++) { table[x, y] = DDDerivations.GetPicture(pic, x * dw, y * dh, dw, dh); } } return(table); }
private static void Add(DDTable <DDPicture> table, string tableName) { table.GetAllCell((x, y, picture) => Add(picture, string.Format("{0}_{1}_{2}", tableName, x, y))); }
public Map(int w, int h) { this.Table = new DDTable <MapCell>(w, h, (x, y) => new MapCell()); }