public string WhenOutWar(string WhoNewOut) { string EnterWord; CountWarPerson--; EnterWord = CountWarPerson + "人战团:" + WhoNewOut + "离开战团"; if (CountWarPerson != 0) { EnterWord += "{"; for (int i = 0; i < CountPerson; i++) { if (AllPerson[i].Name == WhoNewOut) { AllPerson[i].IsInWar = 0; } if (AllPerson[i].IsInWar == 1) { EnterWord += AllPerson[i].Name + "+"; } } EnterWord = EnterWord.Substring(0, EnterWord.Length - 1); EnterWord += "}"; } return(EnterWord); }
public string WhenGetWar(string WhoNewIn) { string EnterWord; //参战人数增加; CountWarPerson++; EnterWord = CountWarPerson + "人战团:" + WhoNewIn + "加入战团" + "{"; for (int i = 0; i < CountPerson; i++) { if (AllPerson[i].Name == WhoNewIn) { AllPerson[i].IsInWar = 1; } if (AllPerson[i].IsInWar == 1) { EnterWord += AllPerson[i].Name + "+"; } } //消除最后一个+号 EnterWord = EnterWord.Substring(0, EnterWord.Length - 1); EnterWord += "}"; return(EnterWord); }