/// <summary> /// 人間性の決定処理 /// </summary> private void humanityChose() { this.choseHumanity = humanitySelectView.getElement(); humanitySelectView.delete(); selectView.detach(); inputIdentity(); }
static Humanity MakeSomeGarbage() { Human h; Humanity c = new Humanity(Globals.maxGarbage); for (int i = 0; i < Globals.maxGarbage; i++) { h = new Human(); } return(c); }
public static int HistoryJobCount(this Humanity list, string job) { int counter = 0; foreach (Human h in list) { if (h.FindJobInHistory(job)) { counter++; } } return(counter); }
public static int CurrentJobCount(this Humanity list, string job) { int counter = 0; foreach (Human h in list) { if (h.Job == job) { counter++; } } return(counter); }
/// <summary> /// パラメータを表示させます /// </summary> /// <param name="job">J職業</param> /// <param name="humanity">人間性</param> /// <param name="identities">特徴のリスト</param> /// <param name="manager">元となるマネージャ</param> public void setParameters(Job job, Humanity humanity, List <Identity> identities, IMissionBuilder builder, CharaMakeManager manager) { nameField.interactable = false; jobText.text = job.getName(); humanityText.text = humanity.getName(); missionText.text = builder.getName(); int i = 0; foreach (Text text in identityTexts) { text.text = identities[i].getName(); i++; } this.manager = manager; }
/// <summary> /// カーソルの移動移動 /// </summary> private void moveCursor() { int axis = 0; float rawAxis = Input.GetAxisRaw("Vertical"); if (rawAxis > 0) { axis = -1; } else if (rawAxis < 0) { axis = 1; } if (axis != 0) { switch (state) { case CharaMakeState.JOB: int index = jobSelectView.getIndex() + axis; Job job = jobSelectView.moveTo(index); jobView.printText(job); break; case CharaMakeState.HUMANITY: Humanity humanity = humanitySelectView.moveTo(humanitySelectView.getIndex() + axis); parameterView.printText(humanity.getName(), humanity.getDescription(), humanity.getFlavorText()); break; case CharaMakeState.IDENTITY: Identity identity = identitySelectView.moveTo(identitySelectView.getIndex() + axis); parameterView.printText(identity.getName(), identity.getDescription(), identity.getFlavorText()); break; case CharaMakeState.MISSION: IMissionBuilder mission = missionSelectView.moveTo(missionSelectView.getIndex() + axis); parameterView.printText(mission.getName(), mission.getDescription(), mission.getFlavorText()); break; } } }
public Calculator(Humanity humanity) { Height = humanity.Height; KG = humanity.KG; }
/// <summary> /// <see cref="T:Character.Hero"/> classのコンストラクタです /// </summary> /// <param name="job">職業</param> public Player(Job job, Humanity humanity, List <Identity> identities, IMissionBuilder mission, string name) { Dictionary <BattleAbility, int> battleParameters = job.defaultSettingBattleAbility(); Dictionary <FriendlyAbility, int> friendlyParameters = job.defaultSettingFriendlyAbility(); activeSkills.AddRange(job.getActiveSkills()); reactionSkills.AddRange(job.getReactionSkills()); setMft(battleParameters[BattleAbility.MFT]); setFft(battleParameters [BattleAbility.FFT]); setMgp(battleParameters [BattleAbility.MGP]); setPhy(battleParameters [BattleAbility.PHY]); setAgi(battleParameters [BattleAbility.AGI]); setDex(friendlyParameters [FriendlyAbility.DEX]); setSpc(friendlyParameters [FriendlyAbility.SPC]); setMaxHp(battleAbilities[BattleAbility.PHY] * 3 + 30); setMaxMp(battleAbilities[BattleAbility.MGP] * 5 + 10); hp = maxHp; mp = maxMp; this.NAME = name; this.job = job; UNIQUE_ID = UniqueIdCreator.creatUniqueId(); this.level = 1; menuPrefab = (GameObject)Resources.Load("Prefabs/Menu"); party.join(this); //もうちとくふうするかも var bKeys = Enum.GetValues(typeof(BattleAbility)); var fKeys = Enum.GetValues(typeof(FriendlyAbility)); foreach (Identity identity in identities) { var battleBonus = identity.getBattleAbilityBonuses(); foreach (BattleAbility ability in bKeys) { battleAbilities[ability] += battleBonus[ability]; } var friBonus = identity.getFriendlyAblityBonuses(); foreach (FriendlyAbility ability in fKeys) { friendlyAbilities[ability] += friBonus[ability]; } identity.activateSkill(this); } humanity.activate(this); foreach (BattleAbility ability in bKeys) { battleAbilities[ability] += humanity.getAbilityBonus(ability); } foreach (FriendlyAbility ability in fKeys) { friendlyAbilities[ability] += humanity.getAbilityBonus(ability); } checkAbilities(); flags = new FlagList(this); this.mission = mission.build(flags); undertakingQuests.Add(this.mission); }
static void Main(string[] args) { DateTime worldTime = DateTime.Now; List <Animal> animals = new List <Animal>(); animals.Add(new Dolphin()); foreach (var animal in animals) { animal.Death += Globals.animalDeathLogger; } System.Timers.ElapsedEventHandler onWorldTimeUpdate = delegate(object sender, System.Timers.ElapsedEventArgs e) { worldTime = worldTime.AddYears(1); animals[0].Live(worldTime); Console.WriteLine($"[{worldTime}] Updating..."); }; System.Timers.Timer worldTimer = new System.Timers.Timer(1000); worldTimer.AutoReset = true; worldTimer.Elapsed += onWorldTimeUpdate; worldTimer.Start(); Console.ReadKey(); Humanity h = new Humanity(5); int c = h.CurrentJobCount("dev"); Human human = new Human(); IFormatter formatter = new BinaryFormatter(); using (Stream stream = new FileStream("data.bin", FileMode.Create)) { formatter.Serialize(stream, human); } Human dp; using (Stream stream = new FileStream("data.bin", FileMode.Open)) { dp = (Human)formatter.Deserialize(stream); } dp.ShowInfo(); Dolphin d = new Dolphin(); using (Stream stream = new FileStream("data.json", FileMode.Create)) { DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(Dolphin)); ser.WriteObject(stream, d); stream.Position = 0; } using (Stream stream = new FileStream("data.json", FileMode.Open)) { DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(Dolphin)); stream.Position = 0; d = (Dolphin)ser.ReadObject(stream); } d.ShowInfo(); Humanity list = new Humanity(5); Console.WriteLine(list.CurrentJobCount("cook")); }
private static void Main(string[] args) { var first = new Humanity(); first.MenuStart(); }