$MissionContext Properties

From Galactineers
Revision as of 19:54, 15 March 2016 by LInsoDeTeh (talk | contribs)
Jump to navigationJump to search

PlayersList

Contains the player Ids of all players in the mission. Player Ids can for example be used in the AddShip command to define a ship owner. The collection supports LINQ.

Example:

$firstPlayerId = $MissionContext->PlayersList[0];


PlayersShipList

Contains all ships controlled by the players. The collection supports LINQ. The ship objects in this collection have the following properties:

Properties
Propterty Type Description
ID integer The Id of the ship generated while using AddShip.
Name string The name of the ship.
Location.X, Location.Y Vector2D The current coordinates of the ship.
Owner string The owner of the ship.
Level integer The level of the ship.
$firstShip = $MissionContext->PlayersShipList[0];
$shipOwner = $firstShip.Owner;
$shipId = $firstShip.ID;

$numberOfShips = $MissionContext->PlayersShipList->Count;

$playerOneShips = from $MissionContext->PlayersShipList as $s where $s.Owner == $shipOwner select $s;