public static void AddDrones(Ship ship) { const int DRONE_BANDWIDTH_ID = 1271; var bandwidth = ship.GetAttributeById(DRONE_BANDWIDTH_ID) .Value; if (bandwidth <= 25) { AddDrones(ship, _hobgoblin, (int) bandwidth / 5); return; } if (bandwidth <= 50) { AddDrones(ship, _hammerhead, (int) bandwidth / 10); AddDrones(ship, _hobgoblin, ((int) bandwidth / 10) / 5); return; } //TODO verteilunug fuer <= 100 sieht normalerweise anders aus AddDrones(ship, _ogre, (int) bandwidth / 25); var rest = (int) bandwidth % 25; AddDrones(ship, _hammerhead, rest / 10); var restMed = rest % 10; AddDrones(ship, _hobgoblin, restMed / 5); }