public static void SetSize(IStatsCollection statsCollection, int quantity) { ITrait trait = statsCollection.GetStat(sizeTraitId); if (trait != null) { trait.Quantity = quantity; } }
public static void SetAttackStrength(IStatsCollection statsCollection, int quantity) { ITrait trait = statsCollection.GetStat(attackStrengthTraitId); if (trait != null) { trait.Quantity = quantity; } }
public static int GetDefenseStrength(IStatsCollection statsCollection) { ITrait trait = statsCollection.GetStat(defenseStrengthTraitId); if (trait == null) { return(defaultDefenseStrength); } return(Mathf.Clamp(trait.Quantity, minDefenseStrength, maxDefenseStrength)); }
public static int GetMoveRadius(IStatsCollection statsCollection) { ITrait trait = statsCollection.GetStat(moveRadiusTraitId); if (trait == null) { return(0); } return(trait.Quantity); }
static float GetSpeed(IStatsCollection statsCollection) { ITrait trait = statsCollection.GetStat(speedTraitId); if (trait == null) { return(defaultSpeed); } return(Mathf.Clamp(trait.Quantity * 1.0f, minSpeed, maxSpeed)); }
public static int GetSize(IStatsCollection statsCollection) { ITrait trait = statsCollection.GetStat(sizeTraitId); if (trait == null) { return(0); } return(trait.Quantity); }
public SensorStateStatsProcessor( ILogger logger, IClientsCollection clientsCollection, IStatsCollection statsCollection, ISensorsHistoryTable sensorsHistory, IClientsHistoryTable clientsHistory) { if (logger == null) throw new ArgumentNullException(nameof(logger)); if (clientsCollection == null) throw new ArgumentNullException(nameof(clientsCollection)); if (statsCollection == null) throw new ArgumentNullException(nameof(statsCollection)); if (sensorsHistory == null) throw new ArgumentNullException(nameof(sensorsHistory)); if (clientsHistory == null) throw new ArgumentNullException(nameof(clientsHistory)); _logger = logger; _clientsCollection = clientsCollection; _statsCollection = statsCollection; _sensorsHistory = sensorsHistory; _clientsHistory = clientsHistory; }
public static int GetRandomAttackStrength(IStatsCollection statsCollection) { float attackStrength = GetAttackStrength(statsCollection); return(Mathf.RoundToInt(Random.Range(minAttackStrength, attackStrength))); }
static float GetSpeedPercentage(IStatsCollection statsCollection) { return(Mathf.InverseLerp(minSpeed, maxSpeed, GetSpeed(statsCollection))); }
public static float GetMoveSpeed(IStatsCollection statsCollection) { return(Mathf.Lerp(minMoveSpeed, maxMoveSpeed, GetSpeedPercentage(statsCollection))); }
public static int GetRandomDefenseStrength(IStatsCollection statsCollection) { float defenseStrength = GetDefenseStrength(statsCollection); return(Mathf.RoundToInt(Random.Range(minDefenseStrength, defenseStrength))); }