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; }
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; }
private void StoneMove(Stones stoneList, Skiers skiList, Bricks brickList) { foreach (Stone st in stoneList) { if (Map.GetItem(st.TOP / 25 + 1, st.LEFT / 25) == ItemName.Skier) { foreach (Skier sk in skiList) { if ((st.LEFT == sk.LEFT) && (st.TOP == (sk.TOP - 25))) { Invalidate(new Rectangle(sk.LEFT, sk.TOP, 25, 25)); Invalidate(new Rectangle(st.LEFT, st.TOP, 25, 25)); Map.SetItem(st.TOP / 25, st.LEFT / 25, ItemName.Null); Map.SetItem(sk.TOP / 25, sk.LEFT / 25, ItemName.Null); //stoneList.RemovePlayer(stoneList.IndexOf(st)); //skiList.RemovePlayer(skiList.IndexOf(sk)); break; } } } } foreach (Stone st in stoneList) { if (st.Moving(trac) == true) { if (st.StoneDirec == Direction.Down) { InvalidateDown(st); } if (st.StoneDirec == Direction.Left) { InvalidateLeft(st); } if (st.StoneDirec == Direction.Right) { InvalidateRight(st); } } } }
private void BombMove(Bombs bombList, Skiers skiList, Bricks brickList) { foreach (Bomb st in bombList) { if (Map.GetItem(st.TOP / 25 + 1, st.LEFT / 25) == ItemName.Skier) { int delSki = Map.GetInd(st.TOP / 25 + 1, st.LEFT / 25); //foreach (Skier sk in skiList) // if ((st.LEFT == sk.LEFT) && (st.TOP == (sk.TOP-25))) // { //Invalidate(new Rectangle(st.LEFT, st.TOP, 25, 25)); Invalidate(new Rectangle(st.LEFT, st.TOP, 25, 50)); Map.SetItem(st.TOP / 25, st.LEFT / 25, ItemName.Null); Map.SetItem(st.TOP / 25 + 1, st.LEFT / 25, ItemName.Null); //bombList.RemovePlayer(bombList.IndexOf(st)); //skiList.RemovePlayer(delSki); // break; // } } } foreach (Bomb st in bombList) { if (st.Moving(trac) == true) { if (st.BombDirec == Direction.Down) { InvalidateDown(st); } if (st.BombDirec == Direction.Left) { InvalidateLeft(st); } if (st.BombDirec == Direction.Right) { InvalidateRight(st); } } } }
private void BombMove(Bombs bombList, Skiers skiList, Bricks brickList) { Int32 countSkier = 0; Int32 [] IndSkier = new Int32[bombList.CountPlayer]; Int32 countBomb = 0; Int32 [] IndBomb = new Int32[bombList.CountPlayer]; foreach (Bomb st in bombList) { if (Map.GetItem(st.TOP / 25 + 1, st.LEFT / 25) == ItemName.Skier) { foreach (Skier sk in skiList) { if ((st.LEFT == sk.LEFT) && (st.TOP == (sk.TOP - 25))) { IndSkier[countSkier] = skiList.IndexOf(sk); IndBomb[countBomb] = bombList.IndexOf(st); Invalidate(new Rectangle(sk.LEFT, sk.TOP, 25, 25)); Invalidate(new Rectangle(st.LEFT, st.TOP, 25, 25)); Map.SetItem(st.TOP / 25, st.LEFT / 25, ItemName.Null); Map.SetItem(sk.TOP / 25, sk.LEFT / 25, ItemName.Null); countSkier++; countBomb++; } } } } Array.Sort(IndSkier); Array.Reverse(IndSkier); Array.Sort(IndBomb); Array.Reverse(IndBomb); for (int i = 0; i < countBomb; i++) { bombList.RemovePlayer(IndBomb[i]); } for (int i = 0; i < countSkier; i++) { skiList.RemovePlayer(IndSkier[i]); } foreach (Bomb st in bombList) { if (st.Moving(trac) == true) { if (st.BombDirec == Direction.Down) { InvalidateDown(st); } if (st.BombDirec == Direction.Left) { InvalidateLeft(st); } if (st.BombDirec == Direction.Right) { InvalidateRight(st); } } } }