using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; using WOMGeneral; using VBXSE; //oooooooooooooooooooooooooooooooooooooooooooo //ooooooooooooo CLIENT ooooooooooooooooooooooo //oooooooooooooooooooooooooooooooooooooooooooo namespace WorldOfMinimalism { public class Cell : CellBase { public int startX = 0; public int startY = 0; public bool drawn = false; public Cell(byte[] serialized) { Deserialize(serialized); } public Cell(int startX = 0, int startY = 0, bool temporary = false) { this.startX = startX; this.startY = startY; if (!temporary) { Initialize(); } else { for (int iy = 0; iy < CELL_HEIGHT; iy++) { for (int ix = 0; ix < CELL_WIDTH; ix++) { tiles[ix, iy] = new Tile(true); AdjustTilePosition(ix, iy); } } } } public override void Move(int offsetX, int offsetY) { this.startX += offsetX; this.startY += offsetY; base.Move(offsetX, offsetY); } public override void AdjustTilePosition(int x, int y) { tiles[x, y].SetSpritePosition(startX + x * 16, startY + y * 16); base.AdjustTilePosition(x, y); } public bool DrawCell(int startX = 0, int startY = 0) { if (!drawn) { this.startX = startX; this.startY = startY; for (int iy = 0; iy < CELL_HEIGHT; iy++) { for (int ix = 0; ix < CELL_WIDTH; ix++) { ((Tile)tiles[ix, iy]).DrawSprite(); tiles[ix, iy].SetSpritePosition(startX * CELL_PIXELWIDTH + ix * 16, startY * CELL_PIXELHEIGHT + iy * 16); } } drawn = true; return true; } return false; } public override void EraseCell() { drawn = false; base.EraseCell(); } } }