barracks: number;
special_attacker_trainer: number;
special_defender_trainer: number;
+ icon: string;
}
export type CityWithLocation = {
this.armyRepository = new ArmyRepository();
}
- async create(accountId: string): Promise<CityWithLocation> {
+ async create(accountId: string, rebel: boolean = false): Promise<CityWithLocation> {
+ const icon = rebel ? `/colony-ships/rebels/${random(1, 6)}.png` : '/colony-ships/01.png';
const info: City = {
id: uuid(),
owner: accountId,
barracks: 0,
special_attacker_trainer: 0,
special_defender_trainer: 0,
+ icon
};
await this.Insert(info);
Math.pow((city2.location_y - city1.location_y), 2)
);
- return _.round(dist/4, 2);
+ // sectors always add 4 hours
+ const sector_dist = Math.abs(city1.sector_id - city2.sector_id) * 6;
+
+ return _.round(dist/4, 2) + sector_dist;
}