PointBonus ContainsBonus(List <PointBonus> bonus_list, PointBonus.Action_Type at) { foreach (PointBonus pb in bonus_list) { if (pb.Equals(at)) { return(pb); } } return(null); }
public int GetPointBonus(PointBonus.Action_Type at_) { int totalPointBonus = 0; PointBonus temp; if (PointBonus.CheckReactive(at_)) //If the action type is reactive only bother checking the reactive type lists. { temp = ContainsBonus(reactive_temp, at_); if (temp != null) { totalPointBonus += temp.pointBonus; } temp = ContainsBonus(reactive_perm, at_); if (temp != null) { totalPointBonus += temp.pointBonus; } } else //Else it's accumulative so only check those list types. { temp = ContainsBonus(accumulative_temp, at_); if (temp != null) { totalPointBonus += temp.pointBonus; } temp = ContainsBonus(accumulative_perm, at_); if (temp != null) { totalPointBonus += temp.pointBonus; } } return(totalPointBonus); }
//Points public void CheckPoints(PointBonus.Action_Type at_) { publicPlayerAttributes.CmdSetPoints(publicPlayerAttributes.PlayerPoints += pk.GetPointBonus(at_)); }