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()); }
/// <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; }
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); }
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(); } }
// 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; } } }
static void Main() { Human Lee = new Human(); Lee.Name = "이순신"; Lee.Age = 32; Console.WriteLine("이름 : " + Lee.Name + ", 나이 : " + Lee.Age); }
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}"); }
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(); }
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()); }
// 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")); }
static void Main() { Human Kim = new Human("김상형", 25); Kim.Intro(); Human Lee = new Human("이순신"); Lee.Intro(); }
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); }
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(); }
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; }
public override void StartBehaviour(Human _theHuman, Transform _theTrans) { base.StartBehaviour (_theHuman, _theTrans); _i = 0; _humanTrans.position = _human.waypoints [_i].position; _i++; _human.IsRunning (true); }
public static void Main() { Human hugYes = new Human(true); Human hugNo = new Human(false); System.Console.WriteLine(hugYes.MaybeHug()); System.Console.WriteLine(hugNo.MaybeHug()); }
private void Start() { human = GetComponent<Human>(); seeker = GetComponent<Seeker>(); seeker.pathCallback += OnPathComplete; UpdateAtt(); }
public static void Main() { string name = "hugo"; double weight = 89.2; Human hugo = new Human(name, weight); Console.WriteLine("name: " + hugo.name); }
static void Main() { Human human = new Human(); human.GetGenderById(9312051224); Console.WriteLine(human); }
static void Main() { Human Kim; Kim = new Human(); Kim.Name = "김상형"; Kim.Age = 25; Kim.Intro(); }
static void Main(string[] args) { Human me = new Human(); if (me is Human) { } }
protected void btnAdd_Click(object sender, EventArgs e) { Human human = new Human(); human.Name = txtBoxName.Text; broker.Insert(human); FillGridView(); }
public HairSaloon() { _waitingRoom = new List<Human>(); _hairDressingChair = null; EnterLock = new object(); ExitLock = new object(); ChairLock = new object(); }
private void Start() { human = GetComponent<Human>(); seeker = GetComponent<Seeker>(); purr = GetComponent<AudioSource>(); seeker.pathCallback += OnPathComplete; human.Speed = NormalSpeed; }
/// <summary> /// Creates new infinity walking task. /// </summary> /// <param name="holder">The holder of this task</param> /// <param name="positionCyrcle">Set of positions the inner move-tasks will lead toward</param> public InfinityWalkingTask(Human holder, IEnumerable<PositionInTown> positionCyrcle) : base(holder) { moveTasks = new Queue<MoveTask>(); foreach (PositionInTown pos in positionCyrcle) { MoveTask mt = new MoveTask(holder, pos); moveTasks.Enqueue(mt); } }
public void TestAdding_ShouldIncreaseNumberOfChips() { IPlayer human = new Human("Player"); var chippAdder = new AddChips(); chippAdder.ChipsAmount = 500; human.Chips += chippAdder.ChipsAmount; Assert.AreEqual(10500, human.Chips, "Player chips should be 10500."); }
public void TestWriteHello() { var human = new Human { Name = "Ding", }; string writeHello = human.WriteHello(); Assert.AreEqual("Hi, I am Ding", writeHello); }
public Human SetSlave(Human human) { if (this.slave != null) { return this.slave.SetSlave(human); } else { this.slave = human; return this; } }
/// <summary> /// Creates the human. /// </summary> /// <returns>A game object base</returns> private GameObjects.IGameObject CreateHuman() { var dodgingObject = new Human(); dodgingObject.Name = "Dodger"; dodgingObject.Size = new System.Drawing.Size(25, 40); dodgingObject.Location = new System.Drawing.Point(216, 500); dodgingObject.ImageLocation = ConfigurationManager.AppSettings["dodgingobjectpic"]; dodgingObject.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; return dodgingObject; }
static void Main(string[] args) { // Because a Dog IS A Animal // This is ok Animal a = new Dog(); a.Talk(); // Same here... a has changed from a Dog instance to a Cat instance // This is called Polymorphism a = new Cat(); a.Talk(); Dog rover = new Dog(); rover.Talk(); Human bryan = new Human(); bryan.Talk(); Dog dori = new Dog(); dori.age = 3; dori.name = "Dori"; dori.breed = "Mongrel"; Dog misty = new Dog(); misty.age = 3; misty.breed = "King Charles"; misty.name = "Misty"; dori.Talk(); misty.Talk(); dori.age = 5; misty.age = 3; misty = dori; misty.age = 4; Console.WriteLine(dori.age); Dog mrT = new Dog(7, "Mr T", "King Charles"); mrT.Talk(); Cat theo = new Cat(); theo.name = "Theodore"; theo.Talk(); while (theo.isAlive) { theo.Die(); } Console.ReadLine(); }
public SleepState(Human human) : base(human) { this.MinEnergyLevel = 0; this.MaxEnergyLevel = 10; }
public static GameObject GetHead(this Human human) => human.head.Obj;
void TongueEat() { if (initTongue) { animationTongue = 0; beat = false; initTongue = false; } animationTongue += Time.deltaTime; if (!beat && animationTongue < animationTongueMax) { Vector3 yVelocity = new Vector3(); Vector3 newPosition = new Vector3(tongue.GetPosition(1).x + (transform.up.x * 0.1f), tongue.GetPosition(1).y + (transform.up.y * 0.1f), 0); tongue.SetPosition(1, Vector3.SmoothDamp(tongue.GetPosition(1), newPosition, ref yVelocity, 0.1f)); if (target) { setObserver(target.position); } else { target = null; } } else if (!beat && animationTongue >= animationTongueMax) { if (!field.visibleTargets.Contains(target)) { target = null; } else { setObserver(target.position); Vector3 oldPos = tongue.GetPosition(1); Vector3 posTarget = target.position; Vector3 yVelocity = new Vector3(); tongue.SetPosition(1, Vector3.SmoothDamp(oldPos, posTarget, ref yVelocity, 0.01f)); if (Vector3.Distance(tongue.GetPosition(1), target.position) < 0.1f) { beat = true; animationTongue = animationTongueMax; } } } else if (beat) { GoBackTongue(); target.position = tongue.GetPosition(1); if (Vector3.Distance(tongue.GetPosition(1), tongue.GetPosition(0)) < 0.1f) { animator.SetBool("eat", false); Player player = target.gameObject.GetComponent <Player>(); Human human = target.gameObject.GetComponent <Human>(); if (player) { GetComponent <AudioSource>().Play(); player.Die(); } else if (human) { human.Die(); } target = null; } } }
public int Heal(Human target) { target.Health += 10 * this.Intelligence; return(target.Health); }
public static Human Copy(this Human u) { return(new Human(u.UnitClass, u.BaseAtk, u.BaseDef, u.BaseSpd, u.MoveRange, u.Potential)); }
public virtual void OnKill(Human Killed) { }
static Database() { var created = new DateTimeOffset(2000, 1, 1, 0, 0, 0, TimeSpan.Zero); var droid1 = new Droid( Id: new Guid("1ae34c3b-c1a0-4b7b-9375-c5a221d49e68"), Name: "R2-D2", PrimaryFunction: "Astromech", ChargePeriod: new TimeSpan(5, 4, 6, 6), Manufactured: new DateTimeOffset(3001, 1, 1, 3, 5, 7, TimeSpan.Zero), Created: created, Modified: created); droid1.Friends.Add(new Guid("94fbd693-2027-4804-bf40-ed427fe76fda")); droid1.Friends.Add(new Guid("c2bbf949-764b-4d4f-bce6-0404211810fa")); droid1.AppearsIn.Add(Episode.NEWHOPE); droid1.AppearsIn.Add(Episode.EMPIRE); droid1.AppearsIn.Add(Episode.JEDI); var droid2 = new Droid( Id: new Guid("c2bbf949-764b-4d4f-bce6-0404211810fa"), Name: "C-3PO", PrimaryFunction: "Protocol", ChargePeriod: new TimeSpan(1, 5, 7, 8), Manufactured: new DateTimeOffset(3002, 2, 2, 15, 44, 32, TimeSpan.FromHours(6)), Created: created, Modified: created); droid2.AppearsIn.Add(Episode.NEWHOPE); droid2.AppearsIn.Add(Episode.EMPIRE); droid2.AppearsIn.Add(Episode.JEDI); var droid3 = new Droid( Id: new Guid("bcf83480-32c3-4d79-ba5d-2bea3bd1a279"), Name: "2-1B", PrimaryFunction: "Surgical", ChargePeriod: new TimeSpan(2, 4, 7, 3), Manufactured: new DateTimeOffset(3003, 3, 3, 6, 5, 47, TimeSpan.FromHours(-4)), Created: created, Modified: created); droid3.AppearsIn.Add(Episode.EMPIRE); Droids = new List <Droid>() { droid1, droid2, droid3, }; var human1 = new Human( Id: new Guid("94fbd693-2027-4804-bf40-ed427fe76fda"), Name: "Luke Skywalker", HomePlanet: "Tatooine", DateOfBirth: new DateTime(3020, 4, 5), Created: created, Modified: created); human1.Friends.Add(new Guid("1ae34c3b-c1a0-4b7b-9375-c5a221d49e68")); human1.Friends.Add(new Guid("c2bbf949-764b-4d4f-bce6-0404211810fa")); human1.AppearsIn.Add(Episode.NEWHOPE); human1.AppearsIn.Add(Episode.EMPIRE); human1.AppearsIn.Add(Episode.JEDI); var human2 = new Human( Id: new Guid("7f7bf389-2cfb-45f4-b91e-9d95441c1ecc"), Name: "Darth Vader", HomePlanet: "Tatooine", DateOfBirth: new DateTime(3000, 3, 1), Created: created, Modified: created); human2.AppearsIn.Add(Episode.NEWHOPE); human2.AppearsIn.Add(Episode.EMPIRE); human2.AppearsIn.Add(Episode.JEDI); Humans = new List <Human>() { human1, human2, }; Characters = Droids.AsEnumerable <Character>().Concat(Humans).ToList(); }
public void PerformingAction() { if (_buildingState == BuildingState.Learn) { if ((int)humans[0]._ageZone < (int)humans[1]._ageZone) { humans[0]._humanSkills.LearnSkills(humans[1]._humanSkills, humans[1]._age.deltaTime, (humans[0]._age.timeEvents[(int)Human.AgeZone.Adult].time.year * 12 + humans[0]._age.timeEvents[(int)Human.AgeZone.Adult].time.month) * GameManager.secondsPerMonth); if (humans[0]._ageZone == Human.AgeZone.Adult) { _buildingState = BuildingState.idle; EventHandler.instance.AddHiddenEvent(EventHandler.EventType.doneTeaching); } } else { humans[1]._humanSkills.LearnSkills(humans[0]._humanSkills, humans[0]._age.deltaTime, (humans[1]._age.timeEvents[(int)Human.AgeZone.Adult].time.year * 12 + humans[1]._age.timeEvents[(int)Human.AgeZone.Adult].time.month) * GameManager.secondsPerMonth); if (humans[1]._ageZone == Human.AgeZone.Adult) { EventHandler.instance.AddHiddenEvent(EventHandler.EventType.doneTeaching); _buildingState = BuildingState.idle; } } } else if (_buildingState == BuildingState.Breed) { if (humans[0]._gender == Human.Gender.female) { breeding[0] = humans[1]; breeding[1] = humans[0]; Human h = humans[1]; h._go.GetComponent <HumanController>().StartCoroutine(h._go.GetComponent <HumanController>().WaitAndLeave()); } else { breeding[0] = humans[0]; breeding[1] = humans[1]; Human h = humans[0]; h._go.GetComponent <HumanController>().StartCoroutine(h._go.GetComponent <HumanController>().WaitAndLeave()); } _buildingState = BuildingState.Work; _age._taskTime = null; _taskDone = false; bool worstMale = true; bool worstFemale = true; foreach (Human h in GameController.instance.gameManager.humanManager.humans) { if (h._gender == breeding[0]._gender && h._humanSkills.SkillModified(HumanSkills.SkillType.Farming).currentAmount < breeding[0]._humanSkills.SkillModified(HumanSkills.SkillType.Farming).currentAmount) { worstMale = false; } else if (h._gender == breeding[1]._gender && h._humanSkills.SkillModified(HumanSkills.SkillType.Farming).currentAmount < breeding[1]._humanSkills.SkillModified(HumanSkills.SkillType.Farming).currentAmount) { worstFemale = false; } } if (worstMale && worstFemale) { EventHandler.instance.AddAchievement(Achievement.incompotent); } if (breeding[1]._age._go.GetComponent <HumanController>().movieAction == ActionType.Talk && GameController.instance.GetComponent <MovieController>().isActiveAndEnabled) { _age._go.GetComponent <BuildingController>().WaitForSpace(breeding[0], breeding[1]); } else { _age.AddTaskEvent(new TimeManager.YearMonth(0, 9)); } } else if (_buildingState == BuildingState.Work) { if (_taskDone) { _taskDone = false; _age._taskTime = null; _age._go.GetComponent <BuildingController>().BirthChild(breeding[0], breeding[1]); } } }
public Human AddHuman(Human human) { human.Id = Guid.NewGuid().ToString(); _humans.Add(human); return(human); }
public static GameObject GetHair(this Human human, int index) => human.hairs.objHairs[index];
static void Main(string[] args) { var address = new Address { City = "Warsaw", Country = "Poland", StreetName = "Marszałkowska", StreetNumber = "10" }; var owner = new Human { Age = 30, Description = "Seems like he want's to buy.", Email = "*****@*****.**", FirstName = "Jan", LastName = "Kowalski" }; var seller = new Human { Age = 52, Email = "*****@*****.**", FirstName = "Marian", LastName = "Maliniak" }; var house = new House { Area = 82.4f, Description = "Nice, sunny appartment in center of Warsaw.", Rooms = 4, HasGarrage = false, Levels = 1, Price = 600000f }; var propertyService = new PropertyService(); var property = propertyService.CreateProperty(owner, seller, house, address); var gradkaService = new GratkaService(); var humanService = new HumanServicec(); var sellerDetails = humanService.CreateNewUserDetails(seller, BLL.Dtos.Role.SELLER); var ownerDetails = humanService.CreateNewUserDetails(owner, BLL.Dtos.Role.OWNER); var offer = gradkaService.CreateOffer(property, ownerDetails, sellerDetails); var isSent = gradkaService.Send(offer); if (isSent == true) { System.Console.WriteLine("We are send the offer"); } else { System.Console.WriteLine("We did not sent the offer"); } System.Console.WriteLine(offer.City); System.Console.WriteLine($"Owner detail is {ownerDetails.FullName}."); System.Console.WriteLine($"Seller detail is {sellerDetails.FullName}."); var bidDto = new BidDto(); bidDto.OfferedPrice = 700000; bidDto.Bidder = new UserDetailsDto(); bidDto.Bidder.Email = "*****@*****.**"; bidDto.Bidder.FullName = "Jan Kowalski"; bidDto.Bidder.Role = Role.UNDEFINED; bidDto.Offer = new GratkaOfferDto(); bidDto.Offer.City = "Gdansk"; bidDto.Offer.Price = 650000; bidDto.Offer.StreetName = "Warszawska"; bidDto.Offer.StreetNumber = "22"; var bidService = new BidService(); var clientOffer = bidService.GetOffer(bidDto); System.Console.WriteLine($"Dom na sprzedaz jest w miescie {clientOffer.House.Address.City}"); }
public abstract void Interact(Human human);
public MarriageRecord GetRecord(Human human) { return(_records.Find(x => (x.HusbandRecord.Human == human || x.WifeRecord.Human == human) && (x.RecordState != RecordState.Obselete))); }
protected override void OnSetUp() { using (var s = OpenSession()) using (var txn = s.BeginTransaction()) { _polliwog = new Animal { BodyWeight = 12, Description = "Polliwog" }; _catepillar = new Animal { BodyWeight = 10, Description = "Catepillar" }; _frog = new Animal { BodyWeight = 34, Description = "Frog" }; _butterfly = new Animal { BodyWeight = 9, Description = "Butterfly" }; _polliwog.Father = _frog; _frog.AddOffspring(_polliwog); _catepillar.Mother = _butterfly; _butterfly.AddOffspring(_catepillar); s.Save(_frog); s.Save(_polliwog); s.Save(_butterfly); s.Save(_catepillar); var dog = new Dog { BodyWeight = 200, Description = "dog" }; s.Save(dog); var cat = new Cat { BodyWeight = 100, Description = "cat" }; s.Save(cat); var dragon = new Dragon(); dragon.SetFireTemperature(200); s.Save(dragon); _zoo = new Zoo { Name = "Zoo" }; var add = new Address { City = "MEL", Country = "AU", Street = "Main st", PostalCode = "3000" }; _zoo.Address = add; _pettingZoo = new PettingZoo { Name = "Petting Zoo" }; var addr = new Address { City = "Sydney", Country = "AU", Street = "High st", PostalCode = "2000" }; _pettingZoo.Address = addr; s.Save(_zoo); s.Save(_pettingZoo); var joiner = new Joiner { JoinedName = "joined-name", Name = "name" }; s.Save(joiner); var car = new Car { Vin = "123c", Owner = "Kirsten" }; s.Save(car); var truck = new Truck { Vin = "123t", Owner = "Steve" }; s.Save(truck); var suv = new SUV { Vin = "123s", Owner = "Joe" }; s.Save(suv); var pickup = new Pickup { Vin = "123p", Owner = "Cecelia" }; s.Save(pickup); var entCompKey = new EntityWithCrazyCompositeKey { Id = new CrazyCompositeKey { Id = 1, OtherId = 1 }, Name = "Parent" }; s.Save(entCompKey); _joe = new Human { Name = new Name { First = "Joe", Initial = 'Q', Last = "Public" } }; _doll = new Human { Name = new Name { First = "Kyu", Initial = 'P', Last = "Doll" }, Friends = new[] { _joe } }; _stevee = new Human { Name = new Name { First = "Stevee", Initial = 'X', Last = "Ebersole" } }; s.Save(_joe); s.Save(_doll); s.Save(_stevee); _intVersioned = new IntegerVersioned { Name = "int-vers", Data = "foo" }; s.Save(_intVersioned); _timeVersioned = new TimestampVersioned { Name = "ts-vers", Data = "foo" }; s.Save(_timeVersioned); var scwc = new SimpleClassWithComponent { Name = new Name { First = "Stevee", Initial = 'X', Last = "Ebersole" } }; s.Save(scwc); var mainEntWithAssoc = new SimpleEntityWithAssociation() { Name = "main" }; var otherEntWithAssoc = new SimpleEntityWithAssociation() { Name = "many-to-many-association" }; mainEntWithAssoc.ManyToManyAssociatedEntities.Add(otherEntWithAssoc); mainEntWithAssoc.AddAssociation("one-to-many-association"); s.Save(mainEntWithAssoc); var owner = new SimpleEntityWithAssociation { Name = "myEntity-1" }; owner.AddAssociation("assoc-1"); owner.AddAssociation("assoc-2"); owner.AddAssociation("assoc-3"); s.Save(owner); var owner2 = new SimpleEntityWithAssociation { Name = "myEntity-2" }; owner2.AddAssociation("assoc-1"); owner2.AddAssociation("assoc-2"); owner2.AddAssociation("assoc-3"); owner2.AddAssociation("assoc-4"); s.Save(owner2); var owner3 = new SimpleEntityWithAssociation { Name = "myEntity-3" }; s.Save(owner3); txn.Commit(); } }
static void Main(string[] args) { string[] inputs; GPS.InitGPS(); Target.Area = "default"; // game loop while (true) { inputs = Console.ReadLine().Split(' '); int x = int.Parse(inputs[0]); Player_x = x; int y = int.Parse(inputs[1]); Player_y = y; int humanCount = int.Parse(Console.ReadLine()); List <Human> humans = new List <Human>(); List <Zombie> zombies = new List <Zombie>(); for (int i = 0; i < humanCount; i++) { inputs = Console.ReadLine().Split(' '); int humanId = int.Parse(inputs[0]); int humanX = int.Parse(inputs[1]); int humanY = int.Parse(inputs[2]); humans.Add(new Human(humanId, humanX, humanY)); } int zombieCount = int.Parse(Console.ReadLine()); for (int i = 0; i < zombieCount; i++) { inputs = Console.ReadLine().Split(' '); int zombieId = int.Parse(inputs[0]); int zombieX = int.Parse(inputs[1]); int zombieY = int.Parse(inputs[2]); int zombieXNext = int.Parse(inputs[3]); int zombieYNext = int.Parse(inputs[4]); zombies.Add(new Zombie(zombieId, zombieX, zombieY, zombieXNext, zombieYNext)); } // Write an action using Console.WriteLine() // To debug: Console.Error.WriteLine("Debug messages..."); foreach (var human in humans) { human.DistanceOfClosestZombie = human.GetDistanceOfClosestZombie(zombies); human.Area = GPS.GetArea(human.X, human.Y); } humans = humans.OrderByDescending(i => i.DistanceOfClosestZombie).ToList(); Human target = GetHumanInMostPopulatedArea(humans, zombies); if (target.Area == "none") { target = humans[0]; } /*if(Target.Area == "default") * { * Target = target; * }*/ Human closest = GetClosestHumanToPlayer(humans); if (closest.InDanger(zombies)) { target = closest; } Console.WriteLine(target.X + " " + target.Y); // Your destination coordinates } }
public void initialiseBullet(Human humanOwner, float bulletSpeed) { this.humanOwner = humanOwner; // this.bulletSpeed = bulletSpeed; transform.parent.parent.GetComponent <Rigidbody2D> ().velocity = new Vector2(bulletSpeed, 0); }
public virtual void OnHit(Human Victim) { }
private void MakeRoomFour(Human h) { }
public void Steal(Human target) { this.Attack(target); this.Health += 10; }
public static void OutputDetails(Human myHuman) { Console.WriteLine(myHuman.GetDetails()); }
public void FixedUpdate() { if (ReplayRecorder.isPlaying || NetGame.isClient) { return; } bool flag = GrabManager.IsGrabbedAny(release.body.gameObject); bool flag2 = GrabManager.IsGrabbedAny(ratchet.body.gameObject); if (!firing && flag && !flag2 && release.GetValue() > release.centerValue && catapultAngle < arm.maxValue - 10f) { hasHuman = false; for (int i = 0; i < Human.all.Count; i++) { Human human = Human.all[i]; bool flag3 = human.groundManager.IsStanding(arm.body.gameObject); bool flag4 = human.grabManager.IsGrabbed(arm.body.gameObject); if (flag3 || flag4) { human.ReleaseGrab(release.body.gameObject); hasHuman = true; human.ragdoll.ToggleHeavyArms(human.ragdoll.partLeftHand.sensor.grabBody == arm.body.GetComponent <Rigidbody>(), human.ragdoll.partRightHand.sensor.grabBody == arm.body.GetComponent <Rigidbody>()); } if (flag3) { StatsAndAchievements.UnlockAchievement(Achievement.ACH_SIEGE_HUMAN_CANNON); } } firing = true; fireTime = 0f; fireStart = catapultAngle; if (releaseSound != null) { releaseSound.Play(); } currentAudioClipDuration = releaseSound.clip.length; currentAudioClipDuration -= 0.5f; StartCoroutine(Wait()); ratchet.release = true; release.SetTarget(release.maxValue); } if (firing && catapultAngle == arm.maxValue) { firing = false; arm.anchor.GetComponent <Rigidbody>().isKinematic = false; ratchet.release = false; release.SetTarget(release.minValue); releaseArmIn = 0.12f; } if (releaseArmIn > 0f) { releaseArmIn -= Time.fixedDeltaTime; if (releaseArmIn <= 0f) { for (int j = 0; j < Human.all.Count; j++) { Human human2 = Human.all[j]; human2.ReleaseGrab(arm.body.gameObject, 0.1f); human2.ragdoll.ReleaseHeavyArms(); } } } if (firing) { fireTime += Time.fixedDeltaTime; catapultAngle = Mathf.Clamp(fireStart + initialAcceleration * fireTime * fireTime / 2f + accelerationAcceleration * fireTime * fireTime * fireTime / 3f, arm.minValue, arm.maxValue); arm.SetTarget(catapultAngle); ratchet.SetValue(Mathf.Lerp(ratchet.minValue, ratchet.maxValue, Mathf.InverseLerp(arm.maxValue, arm.minValue, catapultAngle))); } else { catapultAngle = Mathf.Lerp(arm.maxValue, arm.minValue, Mathf.InverseLerp(ratchet.minValue, ratchet.maxValue, ratchet.GetValue())); arm.SetTarget(catapultAngle); } float num = 1f; if (firing) { num = ((!hasHuman) ? 1.5f : 2f); } else if (GrabManager.IsGrabbedAny(base.gameObject) && !flag && !flag2) { num = 0.2f; } Rigidbody component = GetComponent <Rigidbody>(); Rigidbody component2 = arm.body.GetComponent <Rigidbody>(); if (component.mass != num * initialMass) { component.mass = num * initialMass; component2.mass = num * armMass; } }
public static GameObject[] GetClothes(this Human human) => human.wears.objWear;
private void MakeRoomFive(Human h) { }
public abstract void Execute(Human user);
public static GameObject GetClothes(this Human human, int index) => human.wears.objWear[index];
public void Steal(Human victim) { victim.Health -= 10; Health += 10; }
public static GameObject[] GetHair(this Human human) => human.hairs.objHairs;
static void Main(string[] args) { int q = 0; int stop = 0; //int option = Convert.ToInt32( Console.ReadLine()); //Console.WriteLine(option); //TextWriter tw = new StreamWriter("E:/Runescape txt/player.txt", true); //TextWriter bw = new StreamWriter("E:/Runescape txt/playerinventory.txt", true); //TextWriter cw = new StreamWriter("E:/Runescape txt/playerid.txt", true); //TextWriter dw = new StreamWriter("E:/Runescape txt/playercount.txt", true); //tw.Close(); //cw.Close(); //bw.Close(); //dw.Close(); Console.WriteLine("Hello please enter your username"); string name = Console.ReadLine(); while (stop <= 1) { if (Register(name) == 2) { //Console.Clear(); break; } Register(name); } while (q == 0) { Console.WriteLine("What whould you like to do next"); Console.WriteLine("1.Fight"); Console.WriteLine("2.Shop"); Console.WriteLine("3.Check inventory"); Console.WriteLine("4.Quit"); int choice = Convert.ToInt32(Console.ReadLine()); if (choice == 1) { Console.WriteLine("What monster you wish to fight?"); Console.WriteLine("1.Goblin"); Console.WriteLine("2.Dragon"); int choice1 = Convert.ToInt32(Console.ReadLine()); if (choice1 == 1) { string[] inv = System.IO.File.ReadAllLines(@"E:/Runescape txt/" + name + "inventory.txt"); Console.Clear(); Goblin goblin = new Goblin(); goblin.name = "Goblin"; goblin.health = 10; goblin.strenght = 2; goblin.defence = 1; goblin.Printbase(); Console.WriteLine(""); Human human = new Human(); human.health = 10; human.strenght = 3; human.defence = 1; if (inv[0] == "sword and shield") { human.strenght = 1003; human.defence = 1000; } human.Printhero(); Console.WriteLine(""); while (goblin.health >= 1 && human.health >= 1) { //int num = 1; Console.WriteLine("You hit Goblin for: " + human.strenght + " points of damage"); Console.WriteLine("Goblin manages to defend: " + goblin.defence + " point of damage"); goblin.health = goblin.health - human.strenght + goblin.defence; //Console.WriteLine("Goblin health:" + goblin.health); Console.WriteLine("Goblin hit's you back for: " + goblin.strenght + " points of damage"); Console.WriteLine("You manage to defend: " + human.defence + " points of damage"); human.health = human.health - goblin.strenght + human.defence; Console.WriteLine(""); Console.WriteLine("Goblin health: " + goblin.health); Console.WriteLine("Your health: " + human.health); Console.WriteLine("Press any key to continue.."); Console.ReadKey(); Console.Clear(); } if (goblin.health <= 0) { string loot = "5"; Console.WriteLine("You killed Goblin and got 5 gold"); System.IO.File.WriteAllText(@"E:/Runescape txt/" + name + "gold.txt", loot); Console.WriteLine("Press any key to continue.."); Console.ReadKey(); Console.Clear(); } else { Console.WriteLine("You fainted and lost your gold"); System.IO.File.WriteAllText(@"E:/Runescape txt/" + name + "gold.txt", "0"); Console.WriteLine("Press any key to continue.."); Console.ReadKey(); Console.Clear(); } } else { string[] inv = System.IO.File.ReadAllLines(@"E:/Runescape txt/" + name + "inventory.txt"); Console.Clear(); Dragon dragon = new Dragon(); dragon.name = "Dragon"; dragon.health = 1000; dragon.strenght = 50; dragon.heal = 10; dragon.Printbase(); Console.WriteLine(""); Human human = new Human(); human.health = 10; human.strenght = 3; human.defence = 1; if (inv[0] == "sword and shield") { Console.WriteLine("tiesa"); human.strenght = 1003; human.defence = 1000; } human.Printhero(); Console.WriteLine(""); while (dragon.health >= 1 && human.health >= 1) { Console.WriteLine("You hit Dragon for: " + human.strenght + " points of damage"); Console.WriteLine("Dragon heals: " + dragon.heal + " health"); dragon.health = dragon.health - human.strenght + dragon.heal; Console.WriteLine("Dragon hit's you back for: " + dragon.strenght + " points of damage"); Console.WriteLine("You manage to defend: " + human.defence + " points of damage"); human.health = human.health - dragon.strenght + human.defence; Console.WriteLine(""); if (human.health > 10) { human.health = 10; } Console.WriteLine("Dragon health: " + dragon.health); Console.WriteLine("Your health: " + human.health); Console.WriteLine("Press any key to continue.."); Console.ReadKey(); Console.Clear(); } if (dragon.health <= 0) { string dragonloot = "999"; Console.WriteLine("You killed Dragon and got 999 gold"); System.IO.File.WriteAllText(@"E:/Runescape txt/" + name + "gold.txt", dragonloot); Console.WriteLine("Press any key to continue.."); Console.ReadKey(); Console.Clear(); } else { Console.WriteLine("You fainted and lost your gold"); System.IO.File.WriteAllText(@"E:/Runescape txt/" + name + "gold.txt", "0"); Console.WriteLine("Press any key to continue.."); Console.ReadKey(); Console.Clear(); } } } if (choice == 2) { Console.Clear(); string[] lines = System.IO.File.ReadAllLines(@"D:/Runescape txt/" + name + "gold.txt"); Console.WriteLine("What whould you like to buy"); Console.WriteLine("You have:" + lines[0] + " gold"); Console.WriteLine("1.Sword and shield (gives you +1000 strenght and defence)"); int weaponch = Convert.ToInt32(Console.ReadLine()); if (weaponch == 1) { if (Convert.ToInt32(lines[0]) >= 5) { Console.Clear(); Console.WriteLine("You have succesfully bought sword and shield"); string[] inventory = System.IO.File.ReadAllLines(@"D:/Runescape txt/" + name + "inventory.txt"); System.IO.File.WriteAllText(@"D:/Runescape txt/" + name + "inventory.txt", "sword and shield"); Console.WriteLine("Press any key to continue.."); Console.ReadKey(); Console.Clear(); } else { Console.Clear(); Console.WriteLine("You dont have enouh gold"); Console.WriteLine("Press any key to continue.."); Console.ReadKey(); Console.Clear(); } } } if (choice == 3) { Console.Clear(); string text = System.IO.File.ReadAllText(@"E:/Runescape txt/" + name + "inventory.txt"); System.Console.WriteLine("You have {0}", text); Console.WriteLine("Press any key to continue.."); Console.ReadKey(); Console.Clear(); } if (choice == 4) { break; } } Console.ReadLine(); }
public override Task CreateTask(Human taskHolder) { return(new MoveTask(taskHolder, box.Position)); }
public static GameObject GetAccessory(this Human human, int index) => human.accessories.objAcs[index];