当前位置: 首页>>代码示例>>C#>>正文


C# Planet类代码示例

本文整理汇总了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;
 }
开发者ID:b-small,项目名称:OOP-SoftUni2014,代码行数:7,代码来源:Location.cs

示例2: Location

 public Location(double latitude, double longitude, Planet planet)
     : this()
 {
     Latitude = latitude;
     Longitude = longitude;
     Planet = planet;
 }
开发者ID:i-yotov,项目名称:Courses,代码行数:7,代码来源:Location.cs

示例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;
	}
开发者ID:jcabe4,项目名称:Space-Game,代码行数:25,代码来源:Database.cs

示例4: Location

 public Location(double latitude, double longitude, Planet planetName)
     : this()
 {
     this.Latitude = latitude;
     this.Longitude = longitude;
     this.PlanetName = planetName;
 }
开发者ID:naskoni,项目名称:SoftUni-OOP-November-2015,代码行数:7,代码来源:Location.cs

示例5: Link

    public void Link(Planet planet)
    {
        this.planet = planet;

        planet.hexPlanet = GetComponent<HexPlanet>();
        planet.behavior = this;
    }
开发者ID:rameshvarun,项目名称:TheSixthSun,代码行数:7,代码来源:PlanetBehavior.cs

示例6: NewTroopMovementEvent

 public NewTroopMovementEvent(object sender, Planet startPlanet, Planet targetPlanet, int shipCount)
 {
     Sender = sender;
     StartPlanet = startPlanet;
     TargetPlanet = targetPlanet;
     ShipCount = shipCount;
 }
开发者ID:simonides,项目名称:space_concept,代码行数:7,代码来源:NewTroopMovementEvent.cs

示例7: Location

 public Location(double inputLatitude, double inputLongitude, Planet inputPlanet)
     : this()
 {
     this.Latitude = inputLatitude;
     this.Longitude = inputLongitude;
     this.Planet = inputPlanet;
 }
开发者ID:ScreeM92,项目名称:Software-University,代码行数:7,代码来源:Location.cs

示例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;
    }
开发者ID:rghassem,项目名称:Code,代码行数:30,代码来源:Structure.cs

示例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);
 }
开发者ID:jonathanbull,项目名称:MarsRover,代码行数:7,代码来源:RoverTests.cs

示例10: Location

 public Location(double x, double y,Planet planet):this()
 {
     this.latitude = x;
     this.longitude = y;
     this.planets = planet;
     
 }
开发者ID:petar-rusev,项目名称:OOP,代码行数:7,代码来源:GalacticGPS.cs

示例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;
    }
开发者ID:RachelleJanssen,项目名称:uninformed-bot,代码行数:7,代码来源:mapstate.cs

示例12: MuteerDoelPlaneten

    internal List<Planet> MuteerDoelPlaneten(Planet target)
    {
        int index = NietMijnPlaneten.FindIndex(c => c.PlanetId() == target.PlanetId());
        NietMijnPlaneten[index].Owner(1);

        return NietMijnPlaneten;
    }
开发者ID:RachelleJanssen,项目名称:uninformed-bot,代码行数:7,代码来源:mapstate.cs

示例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;
 }
开发者ID:ScreeM92,项目名称:Software-University,代码行数:7,代码来源:Location.cs

示例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;
    }
开发者ID:MrPhil,项目名称:Space-Exodus,代码行数:60,代码来源:PlanetarySystem.cs

示例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();
    }
开发者ID:Wintastic,项目名称:space4x,代码行数:33,代码来源:Startup.cs


注:本文中的Planet类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。