-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFleetSwarm.cs
More file actions
24 lines (22 loc) · 837 Bytes
/
FleetSwarm.cs
File metadata and controls
24 lines (22 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using System;
namespace OgameDefenseMSO
{
public class FleetSwarm
{
public FleetParticle[] fleetParticles = new FleetParticle[Program.NumParticles];
public Fleet lBestFleet = new Fleet();
public double lBestProfits = double.MinValue;
public FleetSwarm(Defense targetDefense)
{
for (int fleetParticleIdx = 0; fleetParticleIdx < Program.NumParticles; ++fleetParticleIdx)
{
fleetParticles[fleetParticleIdx] = new FleetParticle(targetDefense);
if (fleetParticles[fleetParticleIdx].profits > lBestProfits)
{
lBestProfits = fleetParticles[fleetParticleIdx].profits;
lBestFleet.CopyFleet(fleetParticles[fleetParticleIdx].fleet);
}
}
}
}
}