public void addLife(LifePack lp) { Lifepacks.Add(lp); }
public void removeLife(LifePack lp) { Lifepacks.Remove(lp); }
public void updateMap(String updateS) { //update map with the data recuieved starting with G String[] temp = updateS.Split(':'); for (int i = 1; i < 6; i++) { updatePlayer(temp[i]); } updateBrick(temp[6]); CoinPiles2 = Battle.getCoinList(); Lifepacks2 = Battle.getLifeList(); for (int k = 0; k < CoinPiles2.Count; k++) { CoinPiles2.ElementAt(k).reduceSeconds(); if (CoinPiles2.ElementAt(k).getSeconds() == 0) { tempCoin = CoinPiles2.ElementAt(k); Battle.addObjects(null, tempCoin.getX(), tempCoin.getY()); } } Battle.setCoinList(CoinPiles2); for (int k = 0; k < CoinPiles2.Count; k++) { Lifepacks2.ElementAt(k).reduceSeconds(); if (Lifepacks2.ElementAt(k).getSeconds() == 0) { tempLife = Lifepacks2.ElementAt(k); Battle.addObjects(null, tempLife.getX(), tempLife.getY()); } } Battle.setLifeList(Lifepacks2); }
public void life(String lifeS) { String[] temp = lifeS.Split(':'); String[] cordintes = temp[1].Split(','); int cx, cy, clt; cx = int.Parse(cordintes[0]); cy = int.Parse(cordintes[1]); clt = int.Parse(temp[2]); LifePack lifepack = new LifePack(200, cx, cy, clt,this); Battle.addObjects(lifepack, cx, cy); }
public void removeLifePacks(LifePack lp, int x, int y) { Battle.addObjects(null, x, y); Battle.removeLife(lp); }