protected override void SetupFromSplitJsonString(string[] splitJsonString) { name = splitJsonString[0]; notes = splitJsonString[1]; size = EnumValue.CreateFromJsonString(splitJsonString[2]); restockSettings = RestockSettings.CreateFromJsonString(splitJsonString[3]); m_AvailabilityPerShopSizePerStockType = AvailabilityPerStockTypePerShopSize.Load(splitJsonString[4]); m_RestockFrequencyModifiersPerShopSize = RestockFrequencyModifiersPerShopSize.Load(splitJsonString[5]); m_ReadyCashPerShopSize = ReadyCashPerShopSize.Load(splitJsonString[6]); m_RarityPerCharacterClassPerSpellContainer = RarityPerCharacterClassPerSpellContainer.Load(splitJsonString[7]); m_BudgetRangePerPowerLevelPerStockType = FloatRangePerPowerLevelPerStockType.Load(splitJsonString[8]); m_ArmourCollection = ArmourCollection.Load(splitJsonString[9]); m_SpellCollection = SpellCollection.Load(splitJsonString[10]); m_WeaponCollection = WeaponCollection.Load(splitJsonString[11]); m_RingCollection = RingCollection.Load(splitJsonString[12]); m_RodCollection = RodCollection.Load(splitJsonString[13]); m_StaffCollection = StaffCollection.Load(splitJsonString[14]); m_WondrousCollection = WondrousCollection.Load(splitJsonString[15]); m_ArmourQualityCollection = ArmourQualityCollection.Load(splitJsonString[16]); m_WeaponQualityCollection = WeaponQualityCollection.Load(splitJsonString[17]); m_WeaponQualityConstraintsMatrix = WeaponQualityConstraintsMatrix.Load(splitJsonString[18]); m_ArmourQualityConstraintsMatrix = ArmourQualityConstraintsMatrix.Load(splitJsonString[19]); shops = new Shop[splitJsonString.Length - 20]; for (int i = 0; i < shops.Length; i++) { shops[i] = Shop.CreateFromJsonString(splitJsonString[i + 20]); } }
private void Awake() { _center = new Center(); _center.Name = "Digital Humanities Initiative (DHi)"; _center.Description = "The Digital Humanities Initiative (DHi) at Hamilton College"; _center.Type = CenterType.LiberalArts; _center.Stats.Add(StatType.Funding, new Stat("Funding", 133300)); _center.Stats.Add(StatType.Recognition, new Stat("Recognition", 2)); _center.Stats.Add(StatType.Support, new Stat("Support", 1)); GameObject _uiPanel = Instantiate(Resources.Load("CenterPanel", typeof(GameObject))) as GameObject; _uiPanel.GetComponent <RectTransform>().SetParent(_canvas); _uiPanel.GetComponent <RectTransform>().anchoredPosition = new Vector3(10, -10, 0); _uiPanel.GetComponent <RectTransform>().localScale = Vector3.one; _center.UI = _uiPanel.GetComponent <UICenterPanel>(); _center.UI.Center = _center; _center.UI.Setup(); StaffCollection staff = new StaffCollection(_center); _center.Staff = staff; _center.Staff.OnRosterChange += UI.OnStaffRosterChange; _achievements = new AchievementCollection(); Achievement newAchievement = new Achievement(_center.Stats[StatType.Recognition], 100); newAchievement.Name = "Gettin' that Street Cred"; _achievements.Achievements.Add(newAchievement); newAchievement = new Achievement(_center.Staff, SkillType.Technologist); newAchievement.Name = "Prettier Colors"; _achievements.Achievements.Add(newAchievement); newAchievement = new Achievement(_center.Staff, 1); newAchievement.Name = "It Takes Two"; _achievements.Achievements.Add(newAchievement); newAchievement = new Achievement(_center.Staff, 5); newAchievement.Name = "It's a Party!"; _achievements.Achievements.Add(newAchievement); // Debug.Log(newPlayer.Name + " is level " + newPlayer.Level + " and needs " + newPlayer.XPRequired + "xp to level up."); // Debug.Log(newPlayer.Name + "'s Satisfaction is " + newPlayer.Satisfaction + " and Productiveness is " + newPlayer.Productiveness); _quests = new DefaultQuests(); // Debug.Log(_quests.QuestDictionary[1].Name); _quests.List[1].Activate(); }
public Achievement(StaffCollection staff, int count) { _stat = null; _goal = count; _staff = staff; _goalType = SkillType.None; _isUnlocked = false; _staff.OnRosterChange += OnStaffRosterChange; }
public Achievement(StaffCollection staff, SkillType type) { _stat = null; _goal = 0; _staff = staff; _goalType = type; _isUnlocked = false; _staff.OnRosterChange += OnStaffRosterChange; }
public Achievement(Stat stat, int goal) { _stat = stat; _goal = goal; _staff = null; _goalType = SkillType.None; _isUnlocked = false; _stat.OnValueChange += OnStatValueChange; }
public Center() { _name = string.Empty; _description = string.Empty; _type = CenterType.None; _level = 1; _xp = 0; _xpRequired = Constants.CenterXpPerLevel[_level]; _stats = new Dictionary <StatType, Stat>(); _staff = new StaffCollection(this); _consortia = new List <Consortium>(); }
/// <summary> /// Loads a collection of Staff objects from the database. /// </summary> /// <returns>A collection containing all of the Staff objects in the database.</returns> public static StaffCollection LoadCollection(string spName, SqlParameter[] parms) { StaffCollection result = new StaffCollection(); using (SqlDataReader reader = SqlHelper.Default.ExecuteReader(spName, parms)) { while (reader.Read()) { Staff tmp = new Staff(); tmp.LoadFromReader(reader); result.Add(tmp); } } return(result); }
private void LoadAccounts() { loadStaffs = new StaffCollection(); loadStaffs.LoadStaffFromDb(); gridUsers.Rows.Count = 1; foreach (var popStaff in loadStaffs.pubStaffCollect) { gridUsers.Rows.Count++; gridUsers[gridUsers.Rows.Count - 1, 1] = popStaff.Staff_FName; gridUsers[gridUsers.Rows.Count - 1, 2] = popStaff.Staff_LName; gridUsers[gridUsers.Rows.Count - 1, 3] = popStaff.Staff_MName; gridUsers[gridUsers.Rows.Count - 1, 4] = popStaff.Staff_Username; gridUsers[gridUsers.Rows.Count - 1, 5] = popStaff.Staff_Position; gridUsers[gridUsers.Rows.Count - 1, 6] = popStaff.Staff_Password; gridUsers[gridUsers.Rows.Count - 1, 7] = popStaff.Staff_Id; } }
protected override void SetupFromSplitJsonString(string[] splitJsonString) { name = splitJsonString[0]; notes = CreateStringFromSafeJson(splitJsonString[1]); m_Books = EnumSetting.Load(splitJsonString[2]); m_CharacterClasses = EnumSetting.Load(splitJsonString[3]); m_ShopSizes = EnumSetting.Load(splitJsonString[4]); m_SettlementSizes = EnumSetting.Load(splitJsonString[5]); m_Rarities = EnumSetting.Load(splitJsonString[6]); m_Allowances = EnumSetting.Load(splitJsonString[7]); m_UsesAutomaticBonusProgressionRules = Wrapper <bool> .CreateFromJsonString(splitJsonString[8]); m_UsesMinimumCasterLevelForSpellContainerItems = Wrapper <bool> .CreateFromJsonString(splitJsonString[9]); m_CasterTypesPerCharacterClass = SaveableSelectedEnumPerEnum.Load(splitJsonString[10]); m_WeightingPerRarity = WeightingPerRarity.Load(splitJsonString[11]); m_RestockSettingsPerSettlementSize = RestockSettingsPerSettlementSize.Load(splitJsonString[12]); m_AvailabilityPerShopSizePerStockType = AvailabilityPerStockTypePerShopSize.Load(splitJsonString[13]); m_RestockFrequencyModifiersPerShopSize = RestockFrequencyModifiersPerShopSize.Load(splitJsonString[14]); m_ReadyCashPerShopSize = ReadyCashPerShopSize.Load(splitJsonString[15]); m_RarityPerCharacterClassPerSpellContainer = RarityPerCharacterClassPerSpellContainer.Load(splitJsonString[16]); m_BudgetRangePerPowerLevelPerStockType = FloatRangePerPowerLevelPerStockType.Load(splitJsonString[17]); m_ArmourCollection = ArmourCollection.Load(splitJsonString[18]); m_SpellCollection = SpellCollection.Load(splitJsonString[19]); m_WeaponCollection = WeaponCollection.Load(splitJsonString[20]); m_RingCollection = RingCollection.Load(splitJsonString[21]); m_RodCollection = RodCollection.Load(splitJsonString[22]); m_StaffCollection = StaffCollection.Load(splitJsonString[23]); m_WondrousCollection = WondrousCollection.Load(splitJsonString[24]); m_ArmourQualityCollection = ArmourQualityCollection.Load(splitJsonString[25]); m_WeaponQualityCollection = WeaponQualityCollection.Load(splitJsonString[26]); m_WeaponQualityConstraintsMatrix = WeaponQualityConstraintsMatrix.Load(splitJsonString[27]); m_ArmourQualityConstraintsMatrix = ArmourQualityConstraintsMatrix.Load(splitJsonString[28]); settlements = new Settlement[splitJsonString.Length - 29]; for (int i = 0; i < settlements.Length; i++) { settlements[i] = Settlement.CreateFromJsonString(splitJsonString[i + 29]); } current = this; }
protected override void SetupFromSplitJsonString(string[] splitJsonString) { name = splitJsonString[0]; notes = CreateStringFromSafeJson(splitJsonString[1]); size = splitJsonString[2]; frequencyModifier = Wrapper <float> .CreateFromJsonString(splitJsonString[3]); readyCash = Wrapper <float> .CreateFromJsonString(splitJsonString[4]); stockTypes = FlagsEnumSetting.CreateFromJsonString(splitJsonString[5]); daysSinceLastRestock = Wrapper <int> .CreateFromJsonString(splitJsonString[6]); totalCash = Wrapper <float> .CreateFromJsonString(splitJsonString[7]); specificArmourCollection = SpecificArmourCollection.CreateFromJsonString(splitJsonString[8]); specificPotionCollection = SpecificPotionCollection.CreateFromJsonString(splitJsonString[9]); specificRingCollection = SpecificRingCollection.CreateFromJsonString(splitJsonString[10]); specificRodCollection = SpecificRodCollection.CreateFromJsonString(splitJsonString[11]); specificScrollCollection = SpecificScrollCollection.CreateFromJsonString(splitJsonString[12]); specificStaffCollection = SpecificStaffCollection.CreateFromJsonString(splitJsonString[13]); specificWandCollection = SpecificWandCollection.CreateFromJsonString(splitJsonString[14]); specificWeaponCollection = SpecificWeaponCollection.CreateFromJsonString(splitJsonString[15]); specificWondrousCollection = SpecificWondrousCollection.CreateFromJsonString(splitJsonString[16]); m_RarityPerCharacterClassPerSpellContainer = RarityPerCharacterClassPerSpellContainer.Load(splitJsonString[17]); m_BudgetRangePerPowerLevelPerStockType = FloatRangePerPowerLevelPerStockType.Load(splitJsonString[18]); m_ArmourCollection = ArmourCollection.Load(splitJsonString[19]); m_SpellCollection = SpellCollection.Load(splitJsonString[20]); m_WeaponCollection = WeaponCollection.Load(splitJsonString[21]); m_RingCollection = RingCollection.Load(splitJsonString[22]); m_RodCollection = RodCollection.Load(splitJsonString[23]); m_StaffCollection = StaffCollection.Load(splitJsonString[24]); m_WondrousCollection = WondrousCollection.Load(splitJsonString[25]); m_ArmourQualityCollection = ArmourQualityCollection.Load(splitJsonString[26]); m_WeaponQualityCollection = WeaponQualityCollection.Load(splitJsonString[27]); m_WeaponQualityConstraintsMatrix = WeaponQualityConstraintsMatrix.Load(splitJsonString[28]); m_ArmourQualityConstraintsMatrix = ArmourQualityConstraintsMatrix.Load(splitJsonString[29]); }
void OnStaffRosterChange(object sender, StaffRosterChangeEventArgs args) { StaffCollection staff = (StaffCollection)sender; if (_goal > 0) { if (staff.Roster.Count >= _goal) { Debug.LogError("ACHIEVEMENT UNLOCKED: " + Name); _staff.OnRosterChange -= OnStaffRosterChange; _isUnlocked = true; } } else if (_goalType != SkillType.None) { if (args.Player.Spec == _goalType) { Debug.LogError("ACHIEVEMENT UNLOCKED: " + Name); _staff.OnRosterChange -= OnStaffRosterChange; _isUnlocked = true; } } // else ? }
public Center(string name, CenterType type) { _name = name; _description = string.Empty; _type = type; _level = 1; _xp = 0; _xp = 0; _xpRequired = Constants.CenterXpPerLevel[_level]; _stats = new Dictionary <StatType, Stat>(); _staff = new StaffCollection(this); _consortia = new List <Consortium>(); _stats.Add(StatType.Funding, new Stat("Funding", 3)); _stats.Add(StatType.Time, new Stat("Time", 4)); _stats.Add(StatType.Network, new Stat("Network", 1)); _stats.Add(StatType.Recognition, new Stat("Recognition", 0)); _stats.Add(StatType.Support, new Stat("Support", 0)); _stats.Add(StatType.Mentorship, new Stat("Mentorship", 0)); CalculateTime(); TimeRemaining = _stats[StatType.Time].Value; }
public static SpecificStaff CreateRandom(EnumValue powerLevel, FloatRange budgetRange, StaffCollection staffCollection) { SpecificStaff newSpecificStaff = CreateInstance <SpecificStaff>(); newSpecificStaff.powerLevel = powerLevel; newSpecificStaff.staff = staffCollection.PickStaff(budgetRange); newSpecificStaff.cost = newSpecificStaff.staff.cost; newSpecificStaff.name = newSpecificStaff.staff.name; return(newSpecificStaff); }
public ReverseListIterator(StaffCollection employees) { _employees = employees; _current = employees.Count - 1; }
public ListIterator(StaffCollection employees) { _employees = employees; _current = 0; }
public ReqStaffSkill(SkillType skill, StaffCollection staff) { Name = string.Empty; _skill = skill; _staff = staff; }