/// <summary> /// Returns deprivation bonus multiplier value based on how socially deprived the member is. /// </summary> /// <param name="memberNumberArg"></param> /// <returns></returns> public float GetTrueDeprivationBonusMultiplier(int memberNumberArg) { // if given invalid member number if (memberNumberArg <= 0 || memberNumberArg > memberDeprivationAndDeprivationThreshold.Count) { // print warning to console Debug.LogWarning($"Invalid member number given: {memberNumberArg}"); // return default float return(1f); } // get given member's associated deprivation list entry SerializableDataIntAndInt deprivationEntry = memberDeprivationAndDeprivationThreshold[memberNumberArg - 1]; /// get how many times deprivation has passed the threshold, as unrounded float value. /// NOTE: must cast as floats to do float divison float deprivationSeverityUnrounded = ((float)deprivationEntry.valueInt1) / ((float)deprivationEntry.valueInt2); // round it DOWN to nearest int int deprivationSeverity = Mathf.FloorToInt(deprivationSeverityUnrounded); /// get final value while ensuring it's not below zero. NOTE: have to reduce by /// one due to not wanting to count the first threshold pass deprivationSeverity = Mathf.Max(deprivationSeverity - 1, 0); // return severity value added to base bonus multiplier return(deprivationBonusMultiplierBase + ((float)deprivationSeverity)); }
/// <summary> /// Returns bool that denotes if given member is social interaction deprived. /// </summary> /// <param name="memberNumberArg"></param> /// <returns></returns> public bool isMemberSociallyDeprived(int memberNumberArg) { // if given invalid member number if (memberNumberArg <= 0 || memberNumberArg > memberDeprivationAndDeprivationThreshold.Count) { // print warning to console Debug.LogWarning($"Invalid member number given: {memberNumberArg}"); // return default bool return(false); } // get given member's associated deprivation list entry SerializableDataIntAndInt deprivationEntry = memberDeprivationAndDeprivationThreshold[memberNumberArg - 1]; /// return whether currenlty held deprivation hit the threshold that dictates /// whether member is actually deprived return(deprivationEntry.valueInt1 >= deprivationEntry.valueInt2); }
private void Setup(SerializableDataIntAndInt templateArg) { valueInt1 = templateArg.valueInt1; valueInt2 = templateArg.valueInt2; }
public SerializableDataIntAndInt(SerializableDataIntAndInt templateArg) { Setup(templateArg); }