C# Class Beyond_Beyaan.Galaxy

Datei anzeigen Open project: Beyonders/Beyond-Beyaan Class Usage Examples

Public Properties

Property Type Description
OnGenerateComplete System.Action

Public Methods

Method Description
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

Private Methods

Method Description
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

Method Details

GenerateGalaxy() public method

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
return bool

GenerateTravelNode() public method

public GenerateTravelNode ( StarSystem origin, StarSystem destination ) : TravelNode
origin StarSystem
destination StarSystem
return TravelNode

GenerateTravelNode() public method

public GenerateTravelNode ( float xPos, float yPos, StarSystem destination ) : TravelNode
xPos float
yPos float
destination StarSystem
return TravelNode

GetAllStars() public method

public GetAllStars ( ) : List
return List

GetPath() public method

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
return List

GetStarAtPoint() public method

public GetStarAtPoint ( Point point ) : StarSystem
point Point
return StarSystem

GetStarWithID() public method

public GetStarWithID ( int id ) : StarSystem
id int
return StarSystem

GetStarsInArea() public method

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
return List

Load() public method

public Load ( System.Xml.Linq.XElement root, GameMain gameMain ) : bool
root System.Xml.Linq.XElement
gameMain GameMain
return bool

Reconcilate() public method

public Reconcilate ( EmpireManager empireManager ) : void
empireManager EmpireManager
return void

Save() public method

public Save ( XmlWriter writer ) : void
writer System.Xml.XmlWriter
return void

SetHomeworld() public method

public SetHomeworld ( Empire empire, Planet &homePlanet ) : StarSystem
empire Empire
homePlanet Planet
return StarSystem

Update() public method

public Update ( float frameDeltaTime, Random r ) : void
frameDeltaTime float
r System.Random
return void

Property Details

OnGenerateComplete public_oe property

public Action,System OnGenerateComplete
return System.Action