• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Planet类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Planet的典型用法代码示例。如果您正苦于以下问题:C# Planet类的具体用法?C# Planet怎么用?C# Planet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Planet类属于命名空间,在下文中一共展示了Planet类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: AssignPlanet

 public void AssignPlanet(Planet planet, int orbit)
 {
     if (orbit <= level + 3)
     {
         planets[orbit] = planet;
     }
 }
开发者ID:RaMiSpace,项目名称:SpaceRTS,代码行数:7,代码来源:Star.cs


示例17: BeUnEqualForObjectsWithDifferentValues

        public void BeUnEqualForObjectsWithDifferentValues()
        {
            var p1 = new Planet(
                name: "Mercury",
                massKg: 328500000000000000000000M,
                equatorialDiameterKm: 4879,
                polarDiameterKm: 4879,
                equatorialCircumferenceKm: 15329,
                orbitalDistanceKm: 57909227,
                orbitPeriodEarthDays: 87.97M,
                minSurfaceTemperatureCelsius: -173,
                maxSurfaceTemperatureCelsius: 427);

            var p2 = new Planet(
                name: "Venus",
                massKg: 4867000000000000000000000M,
                equatorialDiameterKm: 12104,
                polarDiameterKm: 12104,
                equatorialCircumferenceKm: 38025,
                orbitalDistanceKm: 108209475,
                orbitPeriodEarthDays: 224.70M,
                minSurfaceTemperatureCelsius: 462,
                maxSurfaceTemperatureCelsius: 462);

            Assert.IsFalse(p1.Equals(p2));
            Assert.IsFalse(p2.Equals(p1));
        }
开发者ID:gerardmchale,项目名称:ImmutableExample,代码行数:27,代码来源:PlanetDomainFShould.cs


示例18: GridIsCreated

        public void GridIsCreated()
        {
            var planet = new Planet(3, 3);

            Assert.That(planet.NumberOfRows, Is.EqualTo(3));
            Assert.That(planet.NumberOfColumns, Is.EqualTo(3));
        }
开发者ID:BrandonGriffin,项目名称:MarsRoverKata,代码行数:7,代码来源:PlanetTests.cs


示例19: BeEqualForObjectsWithSameValues

        public void BeEqualForObjectsWithSameValues()
        {
            var p1 = new Planet(
                name: "Mercury",
                massKg: 328500000000000000000000M,
                equatorialDiameterKm: 4879,
                polarDiameterKm: 4879,
                equatorialCircumferenceKm: 15329,
                orbitalDistanceKm: 57909227,
                orbitPeriodEarthDays: 87.97M,
                minSurfaceTemperatureCelsius: -173,
                maxSurfaceTemperatureCelsius: 427);

            var p2 = new Planet(
                name: "Mercury",
                massKg: 328500000000000000000000M,
                equatorialDiameterKm: 4879,
                polarDiameterKm: 4879,
                equatorialCircumferenceKm: 15329,
                orbitalDistanceKm: 57909227,
                orbitPeriodEarthDays: 87.97M,
                minSurfaceTemperatureCelsius: -173,
                maxSurfaceTemperatureCelsius: 427);

            Assert.IsTrue(p1.Equals(p2));
            Assert.IsTrue(p2.Equals(p1));
        }
开发者ID:gerardmchale,项目名称:ImmutableExample,代码行数:27,代码来源:PlanetDomainFShould.cs


示例20: Polyhedra

 public Polyhedra(Planet p, List<Node> n, List<Edge> e, List<Face> f)
 {
     this.planet = p;
     this.nodes = n;
     this.edges = e;
     this.faces = f;
 }
开发者ID:Andros-Spica,项目名称:RandomPlanetGenerator,代码行数:7,代码来源:PlanetGeneration.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# PlantHue类代码示例发布时间:2022-05-24
下一篇:
C# PlaneProjection类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap