public Victim(int victimID, bool isHelp, bool isEscort, SpawnV position) { this.victimID = victimID; this.isHelp = isHelp; this.isEscort = isEscort; this.position = position; }
//help successful, but not escort yet public void setIsHelp(int mapID, SpawnV position) { if (victimList.ContainsKey(mapID)) { for (int i = 0; i < victimList[mapID].Count; i++) { if (victimList[mapID][i].getPositions() == position) { victimList[mapID][i].setIsHelp(true); } } } }
public int getVictimID(int mapID, SpawnV postion) { int victimID = 0; foreach (KeyValuePair <int, List <Victim> > pair in victimList) { for (int i = 0; i < pair.Value.Count; i++) { if (pair.Key == mapID && pair.Value[i].getPositions() == postion) { victimID = pair.Value[i].getVictimID(); } } } return(victimID); }
//check that this victim is already help or not public bool IsHelp(int mapID, SpawnV position) { bool result = false; if (victimList.ContainsKey(mapID)) { for (int i = 0; i < victimList[mapID].Count; i++) { if (victimList[mapID][i].getPositions() == position) { result = victimList[mapID][i].getIsHelp(); break; } } } return(result); }
public void setPositions(SpawnV position) { this.position = position; }
//return the victim id that player help public int GetVictimID(int key, SpawnV position) { return(victimList.getVictimID(key, position)); }
//set help status of victim in this map, so the next time come to this map victim won't appear public void SetHelpVictim(int key, SpawnV position) { victimList.setIsHelp(key, position); }
//check that is player already help victim in this map or not public bool IsAlreadyHelpVictim(int mapID, SpawnV spawn) { bool alreadyHelp = victimList.IsHelp(mapID, spawn); return(alreadyHelp); }
//check that is there victim in this map or not public bool HaveVictimInMap(int mapID, SpawnV spawn) { bool haveVictim = victimList.haveVictim(mapID, spawn); return(haveVictim); }