/// <summary> /// Constructor to initialize all of its components. /// </summary> /// <param name="data"></param> /// <param name="grid"></param> public GameLoop(DataStoring data, Grid grid) { this.data = data; this.grid = grid; this.renderer = new Renderer(data); gamemanager = new GameManager(grid, data); }
static void Main(string[] args) { DataStoring data = new DataStoring(); Console.OutputEncoding = Encoding.UTF8; // Code for console command inputs. for (int i = 0; i >= 13; i++) { if (args[i] == "-x") { data.MaxX = Convert.ToInt32(args[i + 1]); } else if (args[i] == "-y") { data.MaxY = Convert.ToInt32(args[i + 1]); } else if (args[i] == "-z") { data.Zombies = Convert.ToInt32(args[i + 1]); } else if (args[i] == "-h") { data.Humans = Convert.ToInt32(args[i + 1]); } else if (args[i] == "-Z") { data.PZombies = Convert.ToInt32(args[i + 1]); } else if (args[i] == "-H") { data.PHumans = Convert.ToInt32(args[i + 1]); } else if (args[i] == "-t") { data.MaxTurn = Convert.ToInt32(args[i + 1]); } } Grid grid = new Grid(data); grid.Fill(); Renderer renderer = new Renderer(data); GameLoop gameloop = new GameLoop(data, grid); gameloop.GameLoopStart(); }
public GameManager(Grid grid, DataStoring data) { this.data = data; this.grid = grid; }
/// <summary> /// Initializing with Data. /// </summary> /// <param name="data"></param> public Renderer(DataStoring data) { this.data = data; }
/// <summary> /// Used for copying the grid's information from one grid to another. /// The important information at least. /// </summary> /// <param name="grid"></param> public void Copy(Grid grid) { this.tiles = grid.tiles; this.Data = grid.Data; }
/// <summary> /// Constructor that gives the grid the data it will require. /// </summary> /// <param name="Data"></param> public Grid(DataStoring Data) { this.Data = Data; tiles = new Tile[Data.MaxY, Data.MaxY]; }