本文整理汇总了C#中Planet类的典型用法代码示例。如果您正苦于以下问题:C# Planet类的具体用法?C# Planet怎么用?C# Planet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Planet类属于命名空间,在下文中一共展示了Planet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Location
public Location(double latitude, double longitude, Planet p)
: this()
{
this.Latitude = latitude;
this.Longitude = longitude;
this.CurrentPlanet = p;
}
示例2: Location
public Location(double latitude, double longitude, Planet planet)
: this()
{
Latitude = latitude;
Longitude = longitude;
Planet = planet;
}
示例3: GetStructureList
public List<Structure> GetStructureList(Planet.PlanetType Type)
{
bool bIsAllowed;
List<Structure> AvailableStructures = new List<Structure> ();
for (int i = 0; i < Structures.Count; i++)
{
bIsAllowed = true;
for (int j = 0; j < Structures[i].RestrictedEnvironments.Count; j++)
{
if (Type == Structures[i].RestrictedEnvironments[j])
{
bIsAllowed = false;
}
}
if (bIsAllowed)
{
AvailableStructures.Add(new Structure(Structures[i]));
}
}
return AvailableStructures;
}
示例4: Location
public Location(double latitude, double longitude, Planet planetName)
: this()
{
this.Latitude = latitude;
this.Longitude = longitude;
this.PlanetName = planetName;
}
示例5: Link
public void Link(Planet planet)
{
this.planet = planet;
planet.hexPlanet = GetComponent<HexPlanet>();
planet.behavior = this;
}
示例6: NewTroopMovementEvent
public NewTroopMovementEvent(object sender, Planet startPlanet, Planet targetPlanet, int shipCount)
{
Sender = sender;
StartPlanet = startPlanet;
TargetPlanet = targetPlanet;
ShipCount = shipCount;
}
示例7: Location
public Location(double inputLatitude, double inputLongitude, Planet inputPlanet)
: this()
{
this.Latitude = inputLatitude;
this.Longitude = inputLongitude;
this.Planet = inputPlanet;
}
示例8: Start
// Use this for initialization
protected virtual void Start()
{
if(transform.parent != null)
{
planet = transform.parent.GetComponent<Planet>();
if(planet != null)
{
//if(!CheckRequirements(planet))
// Destroy(gameObject);
}
}
//maintain global scale
if(transform.parent != null)
{
Vector3 correctedScale = new Vector3(transform.localScale.x / transform.parent.localScale.x,
transform.localScale.y / transform.parent.localScale.y,
transform.localScale.z / transform.parent.localScale.z);
transform.localScale = correctedScale;
}
//Initialize
input = new LocalResource[0];
output = new LocalResource();
output.type = LocalResourceType.Power;
output.quantity = 5;
outputRange = DEFAULT_OUTPUT_RANGE;
}
示例9: DeployToPlanet
public void DeployToPlanet()
{
var planet = new Planet();
planet.SetSize(100, 50);
iRover.DeployTo(planet, 0, 0, Movement.CardinalHeading.North);
Assert.IsNotNull(iRover.DeployedTo);
}
示例10: Location
public Location(double x, double y,Planet planet):this()
{
this.latitude = x;
this.longitude = y;
this.planets = planet;
}
示例11: MuteerMijnPlaneet
internal List<Planet> MuteerMijnPlaneet(Planet myPlanet, int strength)
{
int index = MijnPlaneten.FindIndex(c => c.PlanetId() == myPlanet.PlanetId());
MijnPlaneten[index].Sterkte -= strength;
return MijnPlaneten;
}
示例12: MuteerDoelPlaneten
internal List<Planet> MuteerDoelPlaneten(Planet target)
{
int index = NietMijnPlaneten.FindIndex(c => c.PlanetId() == target.PlanetId());
NietMijnPlaneten[index].Owner(1);
return NietMijnPlaneten;
}
示例13: Location
public Location(double latitude, double longitude, Planet planet)
: this() // http://stackoverflow.com/questions/788958/why-do-i-have-to-assign-all-fields-inside-an-structs-constructor
{
this.Latitude = latitude;
this.Longitude = longitude;
this.Planet = planet;
}
示例14: createSystem
public bool createSystem()
{
bool system_created = false;
if(num_planets > 0 ){
//create the system!
base.sub_spheres = new SphereRenderer[num_planets];
/*create the sun!*/
int ptype = 101;
float pmass = 1000000f;
string pname = name + " - Sun";
float pradius = 12f;
float pdistance = 0f;
Vector3 pposition = new Vector3(position.x, Random.Range(-400, 400), position.z);
Debug.Log(pposition);
Planet planet = new Planet(ptype, pmass, pname, pradius, pdistance, pposition);
planet.createPlanet();
factory = (SphereRendererFactory)GameObject.Find("SphereRendererFactory").GetComponent("SphereRendererFactory");
base.sub_spheres[0] = factory.createSphereRenderer();
base.sub_spheres[0].initialize(0, 0, planet_threshold,1 , planet);
base.sub_spheres[0].setIsDisplayed(true);
/* end create sun */
pdistance += 15f;
/*create planets*/
for(int i = 1; i < (num_planets); i++){
float omega = Random.Range(0, 2*Mathf.PI);
/* sphere types
* 0 - Dead
* 1 - Fuel Source
* 2 - Habitable
* 3 - Sun
* 4 - Planetary System
* 5 - System Cluster
*/
ptype = Random.Range(0, 100);
pmass = Random.Range(1000f, 10000f);
pname = name + " - " + i;
pradius = Random.Range(10f, 20f);
pdistance = Random.Range(pdistance, pdistance + 100f);
pposition = new Vector3(position.x + pdistance*Mathf.Cos(omega) , Random.Range(-100, 100), position.z + pdistance*Mathf.Sin(omega));
planet = new Planet(ptype, pmass, pname, pradius, pdistance, pposition);
planet_threshold = pradius + 10f;
if(!planet.createPlanet()){
system_created = false;
break;
}
else{
factory = (SphereRendererFactory)GameObject.Find("SphereRendererFactory").GetComponent("SphereRendererFactory");
base.sub_spheres[i] = factory.createSphereRenderer();
base.sub_spheres[i].initialize(0, 0, planet_threshold,1 , planet);
base.sub_spheres[i].setIsDisplayed(true);
}
system_created = true;
}
}
return system_created;
}
示例15: Start
// Use this for initialization
void Start()
{
Material earthMaterial = Resources.Load("Materials/Earth/Earth") as Material;
Material sunMaterial = Resources.Load("Materials/Sun") as Material;
Material moonMaterial = Resources.Load("Materials/Moon/Moon") as Material;
Star sun = new Star("Sun", new Vector3(0,0,0), 10, sunMaterial);
IList planets = new ArrayList();
for(int i = 0; i < 10; i++) {
// TODO Change x/z random to randomize within a radius of sun instead of square
int x = Random.Range(-200, 200);
int y = 0;
int z = Random.Range(-200, 200);
float r = Random.Range(1, 4);
float spinSpeed = Random.Range(-20, 21);
Planet p = new Planet("Planet" + i, new Vector3(x, y, z), r, earthMaterial, spinSpeed, sun);
planets.Add(p);
int nSatellites = Random.Range(0, 4);
for(int j = 0; j < nSatellites; j++) {
float d = Random.Range(2*r, 8*r);
Vector3 satellitePosition = new Vector3(x+d, y, z);
float satelliteRadius = (float)Random.Range(r, r*5) / 10;
float satelliteSpinSpeed = Random.Range(-20, 21);
p.addSatellite("Satellite"+j+p.name,satellitePosition, satelliteRadius, moonMaterial, satelliteSpinSpeed);
}
}
startUI();
}