C# Класс Beyond_Beyaan.Galaxy

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
OnGenerateComplete System.Action

Открытые методы

Метод Описание
GenerateGalaxy ( GALAXYTYPE galaxyType, int minPlanets, int maxPlanets, Random r, string &reason ) : bool

Set up the galaxy

GenerateTravelNode ( StarSystem origin, StarSystem destination ) : TravelNode
GenerateTravelNode ( float xPos, float yPos, StarSystem destination ) : TravelNode
GetAllStars ( ) : List
GetPath ( float currentX, float currentY, StarSystem currentDestination, StarSystem newDestination, bool hasExtended, Empire whichEmpire ) : List

Pathfinding function

GetStarAtPoint ( Point point ) : StarSystem
GetStarWithID ( int id ) : StarSystem
GetStarsInArea ( float left, float top, float width, float height ) : List

Get all stars in the area for drawing purposes

Load ( System.Xml.Linq.XElement root, GameMain gameMain ) : bool
Reconcilate ( EmpireManager empireManager ) : void
Save ( XmlWriter writer ) : void
SetHomeworld ( Empire empire, Planet &homePlanet ) : StarSystem
Update ( float frameDeltaTime, Random r ) : void

Приватные методы

Метод Описание
FillGalaxyWithStars ( int numberOfStars, int minPlanets, int maxPlanets, bool grid, Random r ) : void
GenerateGalaxyCompleted ( object sender, RunWorkerCompletedEventArgs e ) : void
GenerateGalaxyThread ( object sender, DoWorkEventArgs e ) : void
GenerateRandom ( GALAXYTYPE type ) : bool[][]
IsDestinationValid ( StarSystem destination, bool hasExtended, Empire whichEmpire ) : bool

Описание методов

GenerateGalaxy() публичный Метод

Set up the galaxy
public GenerateGalaxy ( GALAXYTYPE galaxyType, int minPlanets, int maxPlanets, Random r, string &reason ) : bool
galaxyType GALAXYTYPE
minPlanets int
maxPlanets int
r System.Random
reason string
Результат bool

GenerateTravelNode() публичный Метод

public GenerateTravelNode ( StarSystem origin, StarSystem destination ) : TravelNode
origin StarSystem
destination StarSystem
Результат TravelNode

GenerateTravelNode() публичный Метод

public GenerateTravelNode ( float xPos, float yPos, StarSystem destination ) : TravelNode
xPos float
yPos float
destination StarSystem
Результат TravelNode

GetAllStars() публичный Метод

public GetAllStars ( ) : List
Результат List

GetPath() публичный Метод

Pathfinding function
public GetPath ( float currentX, float currentY, StarSystem currentDestination, StarSystem newDestination, bool hasExtended, Empire whichEmpire ) : List
currentX float Fleet's Galaxy X
currentY float Fleet's Galaxy Y
currentDestination StarSystem Fleet's current destination for when empire don't have hyperspace communications
newDestination StarSystem New destination
hasExtended bool
whichEmpire Empire For fuel range and other info
Результат List

GetStarAtPoint() публичный Метод

public GetStarAtPoint ( Point point ) : StarSystem
point Point
Результат StarSystem

GetStarWithID() публичный Метод

public GetStarWithID ( int id ) : StarSystem
id int
Результат StarSystem

GetStarsInArea() публичный Метод

Get all stars in the area for drawing purposes
public GetStarsInArea ( float left, float top, float width, float height ) : List
left float
top float
width float
height float
Результат List

Load() публичный Метод

public Load ( System.Xml.Linq.XElement root, GameMain gameMain ) : bool
root System.Xml.Linq.XElement
gameMain GameMain
Результат bool

Reconcilate() публичный Метод

public Reconcilate ( EmpireManager empireManager ) : void
empireManager EmpireManager
Результат void

Save() публичный Метод

public Save ( XmlWriter writer ) : void
writer System.Xml.XmlWriter
Результат void

SetHomeworld() публичный Метод

public SetHomeworld ( Empire empire, Planet &homePlanet ) : StarSystem
empire Empire
homePlanet Planet
Результат StarSystem

Update() публичный Метод

public Update ( float frameDeltaTime, Random r ) : void
frameDeltaTime float
r System.Random
Результат void

Описание свойств

OnGenerateComplete публичное свойство

public Action,System OnGenerateComplete
Результат System.Action