军团活动:诸侯混战自动宣战

This commit is contained in:
luying
2022-04-24 20:52:45 +08:00
parent e5f802c477
commit a89788415d
4 changed files with 41 additions and 38 deletions
@@ -36,12 +36,17 @@ export class CityActivityObject {
}
}
public hasSent(serverId: number, cityId: number) {
let key = this.getKey(serverId, cityId);
return this.sentCity.indexOf(key) != -1;
}
public getAllCities() {
let allCities = new Array<{ serverId: number, cityId: number, guildCodes: string[]}>();
let serverlists = new Array<number>();
for(let [key, guildCodes] of this.cities) {
if(this.sentCity.indexOf(key) == -1) {
let { serverId, cityId } = this.decodeKey(key);
let { serverId, cityId } = this.decodeKey(key);
if(!this.hasSent(serverId, cityId)) {
allCities.push({ serverId, cityId, guildCodes });
if(!serverlists.includes(serverId)) serverlists.push(serverId);
}