File: _fleet_position.py

package info (click to toggle)
freeorion 0.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 194,940 kB
  • sloc: cpp: 186,508; python: 40,969; ansic: 1,164; xml: 719; makefile: 32; sh: 7
file content (10 lines) | stat: -rw-r--r-- 368 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
import freeOrionAIInterface as fo

from AIDependencies import INVALID_ID
from common.fo_typing import FleetId, SystemId


def get_fleet_position(fleet_id: FleetId) -> SystemId:
    """Return system where fleet is located or moving to."""
    fleet = fo.getUniverse().getFleet(fleet_id)
    return fleet.systemID if fleet.systemID != INVALID_ID else fleet.nextSystemID