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

C# Human类代码示例

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

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



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

示例1: Main

    static void Main(string[] args)
    {
        Human cason = new Human();
            Human justin = new Human();
            justin.MaxRunningSpeed = 20;

            cason.Age = 27;
            cason.EducationLevel = "Yes, pleaase";
            cason.IsAlive = true;

            bool wasAbleToRun = cason.Run(12);

            if (wasAbleToRun)
            {
                Console.WriteLine("Yeah, go Cason!!");
            }
            else
            {
                Console.WriteLine("You can't run, Cason!!");
            }

            wasAbleToRun = justin.Run(12);

            if (wasAbleToRun)
            {
                Console.WriteLine("Yeah, go Justin!!");
            }
            else
            {
                Console.WriteLine("You can't run, Jusin!!");
            }

            Console.WriteLine($"Age = {cason.Age}, IsAlive = {cason.IsAlive}");
    }
开发者ID:TIY-LR-NET-2015-Fall,项目名称:Week-1-Day-4,代码行数:34,代码来源:classes-human.cs


示例2: Main

        static void Main(string[] args)
        {
            Console.Title = "RepoProject Test Program";

            List<Animal> animals = new List<Animal>();

            Human sawyer = new Human();
            sawyer.Age = 35;
            sawyer.Gender = "Male";
            sawyer.Name = "Groda Lotsapot";

            Dog scooby = new Dog();
            scooby.Age = 3;
            scooby.Gender = "Male";
            scooby.Name = "Scooby";

            animals.Add(sawyer);
            animals.Add(scooby);


            foreach (Animal item in animals)
            {
                Console.WriteLine("Please meet " + item.Name + ". They are " + item.Age + " years old.");
                if (item.GetType() == typeof(Dog))
                {
                    Dog d = (Dog)item;
                    Console.WriteLine("That's " + d.DogYears + " in dogyears!");
                }
            }

            Console.ReadKey();
        }
开发者ID:GLotsapot,项目名称:MyFirstRepo,代码行数:32,代码来源:Program.cs


示例3: Start

    private void Start()
    {
        if (Guard._player == null)
            Guard._player = GameObject.FindGameObjectWithTag("Player").transform;
        if (Guard._playerr == null)
            Guard._playerr = Guard._player.GetComponent<Rigidbody>();

        if (Camera == null) Camera = Camera.main;
        _human = GetComponent<Human>();
        _human.IdleLook = () =>
        {
            if (Hack == null)
            {
                if (Physics.Raycast(Camera.ScreenPointToRay(Input.mousePosition), out _hit))
                {
                    var m = _hit.point + transform.right * 0.25f;
                    m.y = transform.position.y;
                    transform.LookAt(m); // TODO lerp
                }
            }
        };
        _human.Forward = Camera.transform.forward;
        _human.Forward.y = 0;
        _human.Right = Camera.transform.right;
        _human.Right.y = 0;
        _switches = GameObject.FindGameObjectsWithTag("Switch");

        GetComponent<AudioSource>().PlayOneShot(TeleClip, 0.8f);
    }
开发者ID:Dyhr,项目名称:LD33-Stealth-Game,代码行数:29,代码来源:Player.cs


示例4: CheckSurrounding

        public void CheckSurrounding(Human LeMe, List<Human> HumansInSight)
        {
            if (LeMe.Victim.HumanType == HumanType.Dead)
            {
                LeMe.DecisionBehaviour = new UsualDecisionBehaviour();
                LeMe.MovementBehaviour = new UsualMovementBehaviour();
                LeMe.HumanType = HumanType.Normal;
            }

            foreach(Human h in HumansInSight)
            {
                if (h.HumanType != HumanType.Dead)
                {
                    continue;
                }

                if (!((LeMe.Position - h.Position).Length() < 70.0f))
                {
                    continue;
                }

                LeMe.Node = h.Position;

                LeMe.MovementBehaviour = new EvadeMovementBehaviour();
            }
        }
开发者ID:dd8kb,项目名称:CrowdSimulator,代码行数:26,代码来源:AgentDecisionBehaviour.cs


示例5: HumanDeathCloud

    public HumanDeathCloud(Human human)
        : base(human.entityArea)
    {
        this.human = human;

        this.x = human.x;
        this.y = human.y+4;

        frames = new FAtlasElement[]
        {
            Futile.atlasManager.GetElementWithName("Arena/Vill_Death1"),
            Futile.atlasManager.GetElementWithName("Arena/Vill_Death2"),
            Futile.atlasManager.GetElementWithName("Arena/Vill_Death3"),
            Futile.atlasManager.GetElementWithName("Arena/Vill_Death4")
        };

        cloudHolder = new FContainer();

        cloudSprite = new FSprite(frames[0]);
        cloudSprite.scaleX = RXRandom.Bool() ? -1f : 1f;
        cloudHolder.AddChild(cloudSprite);
        cloudSprite.shader = FShader.Additive;
        cloudSprite.alpha = RXRandom.Range(0.8f,0.9f);
        cloudSprite.color = human.player.player.color.color + new Color(0.1f,0.1f,0.1f,0.0f);
        cloudSprite.scale = 2.0f;

        graveHolder = new FContainer();
        graveSprite = new FSprite("Arena/Human_Grave_1");
        graveHolder.AddChild(graveSprite);
        graveSprite.color = human.player.player.color.color + new Color(0.5f,0.5f,0.5f);

        graveSprite.y =  16;

        Update();
    }
开发者ID:BoarK,项目名称:BewareWolf,代码行数:35,代码来源:HumanDeathCloud.cs


示例6: Start

    // Use this for initialization
    void Start()
    {
        thisHuman = this.GetComponent<Human>();
        GameController.player = this;
        inventory = new string[7];
        inventory[0] = "";
        inventory[1] = "";
        inventory[2] = "";
        inventory[3] = "";
        inventory[4] = "";
        inventory[5] = "";
        inventory[6] = "";

        int failTest = 1000;
        while(failTest > 0){
            failTest--;
            Town selectedTown = TerrainController.townList[Random.Range(0, TerrainController.townList.Count)];
            if(selectedTown.HouseList.Count == 0){
                continue;
            }else{
                Vector2 newPos = selectedTown.HouseList[Random.Range(0, selectedTown.HouseList.Count)];
                this.transform.position = new Vector3(newPos.x, 0, newPos.y);
                break;
            }
        }
    }
开发者ID:balohmatevz,项目名称:WorldInVenom,代码行数:27,代码来源:Player.cs


示例7: CharacterManager

    // Ctor & Methods //
    public CharacterManager()
    {
        _human = new Human("Bobby");
        _dog = new Dog("Billy");

        SelectedCharacter = _human;

        _enemies = new List<Enemy>();
        _enemies.Add(new Enemy("Steve"));
        _enemies.Add(new Enemy("Steve"));
        _enemies.Add(new Enemy("Steve"));
        _enemies.Add(new Enemy("Steve"));
        _enemies.Add(new Enemy("Steve"));
        _enemies.Add(new Enemy("Steve"));
        _enemies.Add(new Enemy("Steve"));
        _enemies.Add(new Enemy("Steve"));
        _enemies.Add(new Enemy("Steve"));
        _enemies.Add(new Enemy("Steve"));
        _enemies.Add(new Enemy("Steve"));
        _enemies.Add(new Enemy("Steve"));
        _enemies.Add(new Enemy("Steve"));
        _enemies.Add(new Enemy("Steve"));
        _enemies.Add(new Enemy("Steve"));
        _enemies.Add(new Enemy("Steve"));
        _enemies.Add(new Enemy("Steve"));
        _enemies.Add(new Enemy("Steve"));
        _enemies.Add(new Enemy("Steve"));
        _enemies.Add(new Enemy("Steve"));
        _enemies.Add(new Enemy("Steve"));
        _enemies.Add(new Enemy("Steve"));
        _enemies.Add(new Enemy("Steve"));
        _enemies.Add(new Enemy("Steve"));
    }
开发者ID:timothythiecke,项目名称:SecretOfEvermore,代码行数:34,代码来源:CharacterManager.cs


示例8: PlacePersonHouse

    /// <summary>
    /// placing a person in a house if false is returned then cant find a spot or the person does not exsist
    /// </summary>
    /// <param name="thePerson"> The person to place</param>
    /// <returns> if can be placed</returns>
    public  bool PlacePersonHouse(Human thePerson)
    {
       
        if (!thePerson) // if nothing is passed then cant find a point for them
        {
            Debug.Log("1");
            return false;

        }
        
        for (int i = 0; i < peopleList.Length; i++)
        {
            if (peopleList[i] == thePerson)
            {
                return false;
            }

        }
        int hold = NextEmptySlot();

        if (hold<0) // if there are no empty slots return false
        {
            Debug.LogError("no empty slots" + thePerson.name + " " + name);
            return false;
        }
        
        peopleList[hold] = thePerson;
        thePerson.transform.position = peoplePoint[hold].position;
        thePerson.shelterNum = shelterID;
        return true;
    }
开发者ID:blueblob0,项目名称:CommunityAi,代码行数:36,代码来源:Shelter.cs


示例9: Main

 static void Main()
 {
     Human Kim = new Human("김상형", 25);
     Kim.Intro();
     Human Lee = new Human("이순신");
     Lee.Intro();
 }
开发者ID:gawallsibya,项目名称:BIT_MFC-CShap-DotNet,代码行数:7,代码来源:Program.cs


示例10: MainFunction

    private void MainFunction()
    {
        Debug.Log("Hello C Sharp");

        int a = 3;

        int []jackArray = new int[3];

        jackArray[0] = 2;
        jackArray[1] = 8;
        jackArray[2] = 5;

        int []maryArray = new int[]{7,8,9};

        jackArray = maryArray;
        maryArray[0] = 999;

        int result = jackArray[0];

        //Debug.Log("result : "+result);

        Human h = new Human();
        h.name = "Raiden";

        Human g = new Human();
        g.name = "Takisawa";

        Human k = null;
        k = h;

        h = g;
        Debug.Log(h.name);
    }
开发者ID:korokoso,项目名称:Pada,代码行数:33,代码来源:LearnCSharp2.cs


示例11: Button_Click

 private void Button_Click(object sender, RoutedEventArgs e)
 {
     Human h = new Human();
     School.SetGrade(h, 6);
     int grade = School.GetGrade(h);
     MessageBox.Show(grade.ToString());
 }
开发者ID:BerdyPango,项目名称:Researches,代码行数:7,代码来源:Demo_AttachedProperty.xaml.cs


示例12: Main

	public static void Main()
	{
		Console.WriteLine(Human.Planet);

		Human man = new Human(17, "Ilya");
		man.Print_Inf();

		Human second_man = new Human(24, "Alex", city: "Minsk");
		second_man.Print_Inf();

		Console.WriteLine("In what city there lives the man? ");
		man.City = Console.ReadLine();

		Console.WriteLine("In what country there lives the second_man? ");
		second_man.Country = Console.ReadLine();

		Console.WriteLine("\nNew information: \n");
		man.Print_Inf();
		second_man.Print_Inf();

		Console.WriteLine("Press any key to do nothing :)");
		Console.Read();
		Console.WriteLine();
		man.do_something();
		Console.WriteLine("");

		Console.WriteLine("What can the man do? ");
		man.do_something(Console.ReadLine());
	}		
开发者ID:antonid08,项目名称:BSUIR_LABS,代码行数:29,代码来源:main.cs


示例13: Main

 static void Main()
 {
     Human Lee = new Human();
     Lee.Name = "이순신";
     Lee.Age = 32;
     Console.WriteLine("이름 : " + Lee.Name + ", 나이 : " + Lee.Age);
 }
开发者ID:gawallsibya,项目名称:BIT_MFC-CShap-DotNet,代码行数:7,代码来源:Program.cs


示例14: Move

        public Vec2 Move(Human LeMe, IEnumerable<Human> NearestNeighbours)
        {
            if ((LeMe.Node - LeMe.Position).Length() > 100.0f)
            {
                LeMe.Node = this.GetNewTarget(LeMe);

                if (LeMe.HumanType == HumanType.Agent)
                {
                    LeMe.MovementBehaviour = new AgentMovementBehaviour();
                }
                else
                {
                    LeMe.MovementBehaviour = new UsualMovementBehaviour();
                }
            }

            this.velocity = LeMe.Node - LeMe.Position;
            this.velocity.Mul(-1.0f);

            this.velocity.Mul(1.0f / this.velocity.Length());

            this.velocity.Mul(this.speed);

            foreach (var human in NearestNeighbours.Where(Human => Human.Position != LeMe.Position && !(Human.HumanType != HumanType.Agent && LeMe.HumanType == HumanType.Victim)))
            {
                this.distance = human.Position - LeMe.Position;

                var num = this.distance.Length();

                distance.Mul(1.0f / distance.Length());

                distance.Mul(1.7f);

                if (!(num <= 15.0f))
                {
                    continue;
                }

                num = 15.0f - num;

                num /= 15.0f;

                this.distance.Mul(num * -1f);

                this.distance.Mul(3.5f);

                this.velocity += this.distance;

                this.distance = human.Position - LeMe.Position;
            }

            this.velocity.Mul(1.0f / this.velocity.Length());

            this.velocity.Mul(this.speed);

            LeMe.Position = LeMe.Position + this.velocity;

            return LeMe.Position;
        }
开发者ID:dd8kb,项目名称:CrowdSimulator,代码行数:59,代码来源:EvadeMovementBehaviour.cs


示例15: Main

    static void Main()
    {
        Human human = new Human();

        human.GetGenderById(9312051224);

        Console.WriteLine(human);
    }
开发者ID:sabrie,项目名称:TelerikAcademy,代码行数:8,代码来源:HumanTest.cs


示例16: Start

    private void Start()
    {
        human = GetComponent<Human>();
        seeker = GetComponent<Seeker>();
        seeker.pathCallback += OnPathComplete;

        UpdateAtt();
    }
开发者ID:Dyhr,项目名称:GGJ16-TheEverydayMorningRoutineOfAnOrdinaryMan,代码行数:8,代码来源:Player.cs


示例17: StartBehaviour

 public override void StartBehaviour(Human _theHuman, Transform _theTrans)
 {
     base.StartBehaviour (_theHuman, _theTrans);
     _i = 0;
     _humanTrans.position = _human.waypoints [_i].position;
     _i++;
     _human.IsRunning (true);
 }
开发者ID:jesterswilde,项目名称:LD33_Monster,代码行数:8,代码来源:Human.cs


示例18: Main

    public static void Main()
    {
        Human hugYes = new Human(true);
         Human hugNo = new Human(false);

         System.Console.WriteLine(hugYes.MaybeHug());
         System.Console.WriteLine(hugNo.MaybeHug());
    }
开发者ID:hypatian,项目名称:maybe-hugs,代码行数:8,代码来源:HelloHug.cs


示例19: Main

 static void Main()
 {
     Human Kim;
     Kim = new Human();
     Kim.Name = "김상형";
     Kim.Age = 25;
     Kim.Intro();
 }
开发者ID:gawallsibya,项目名称:BIT_MFC-CShap-DotNet,代码行数:8,代码来源:Program.cs


示例20: Main

        static void Main(string[] args)
        {
            Human me = new Human();
            if (me is Human)
            {

            }
        }
开发者ID:cleancodenz,项目名称:LEDA,代码行数:8,代码来源:Program.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# HydraTaskSettings类代码示例发布时间:2022-05-24
下一篇:
C# HugeInt类代码示例发布时间: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