public PlaceList(Bricks brickList, BlueBricks blueBrickList, Soils soilList, Stones stoneList, Skiers skiList, Bombs bombList, Player trac, Player trac2) { foreach (Brick br in brickList) { bricks.AddPlayer(br); } foreach (BlueBrick br in blueBrickList) { blueBricks.AddPlayer(br); } foreach (Soil br in soilList) { soils.AddPlayer(br); } foreach (Stone br in stoneList) { stones.AddPlayer(br); } foreach (Skier br in skiList) { skiers.AddPlayer(br); } foreach (Bomb br in bombList) { bombs.AddPlayer(br); } thisPlayer = trac; thisPlayer2 = trac2; }
public void SetList(ref Bricks brickList, ref BlueBricks blueBrickList, ref Soils soilList, ref Stones stoneList, ref Skiers skiList, ref Bombs bombList, ref Player trac, ref Player trac2) { foreach (Brick br in bricks) { brickList.AddPlayer(br); } foreach (BlueBrick br in blueBricks) { blueBrickList.AddPlayer(br); } foreach (Soil br in soils) { soilList.AddPlayer(br); } foreach (Stone br in stones) { stoneList.AddPlayer(br); } foreach (Skier br in skiers) { skiList.AddPlayer(br); } foreach (Bomb br in bombs) { bombList.AddPlayer(br); } trac = thisPlayer; trac2 = thisPlayer2; }
private void On_CreateNewMap(object sender, System.EventArgs e) { CreateNewMap myMapDialog = new CreateNewMap(); myMapDialog.ShowDialog(); if (myMapDialog.DialogResult == DialogResult.OK) { this.timer1.Enabled = false; this.IsCreateNewMap = true; SelectedItem = "NULL"; trac = new Player(0, 0, "NULL.bmp"); trac2 = new Player(5, 0, "NULL.bmp"); menuItemPlayer1.Enabled = true; menuItemPlayer2.Enabled = true; brickList.ClearAll(); blueBrickList.ClearAll(); soilList.ClearAll(); stoneList.ClearAll(); skiList.ClearAll(); bombList.ClearAll(); Invalidate(); menuItemPlayer.Enabled = true; menuItemSkier.Enabled = true; menuItemBomb.Enabled = true; menuItemStone.Enabled = true; menuItemSoil.Enabled = true; menuItemBrick.Enabled = true; menuItemBlueBrick.Enabled = true; Map.ClearMap(); foreach (Skier sk in skiList) { Map.SetItem(sk); } foreach (Stone st in stoneList) { Map.SetItem(st); } foreach (Bomb bo in bombList) { Map.SetItem(bo); } foreach (Brick br in brickList) { Map.SetItem(br); } foreach (BlueBrick bbr in blueBrickList) { Map.SetItem(bbr); } foreach (Soil so in soilList) { Map.SetItem(so); } Map.SetItem(trac); Map.SetItem(trac2); if (myMapDialog.DrawBorder == true) { Int32 x = myMapDialog.CoordinateX; Int32 y = myMapDialog.CoordinateY; for (int xx = 0; xx < x + 2; xx++) { brickList.AddPlayer(new Brick(xx, 0)); } for (int yy = 1; yy < y + 1; yy++) { brickList.AddPlayer(new Brick(0, yy)); } for (int xx = 0; xx < x + 2; xx++) { brickList.AddPlayer(new Brick(xx, y + 1)); } for (int yy = 1; yy < y + 1; yy++) { brickList.AddPlayer(new Brick(x + 1, yy)); } } } }