Created
December 13, 2016 00:47
-
-
Save victoraldecoa/e5d36b3a47d71e4b91536e815d3b308d to your computer and use it in GitHub Desktop.
Daily Weapon algorithm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_currentDailyWeapon = _possibleWeapons[0]; | |
foreach( var weapon in _possibleWeapons) | |
{ | |
if(weapon.HardCurrencyCost.HasValue && _currentDailyWeapon.HardCurrencyCost.HasValue) | |
{ | |
if( weapon.HardCurrencyCost.Value < _currentDailyWeapon.HardCurrencyCost.Value) | |
_currentDailyWeapon = weapon; | |
} | |
else if(weapon.SoftCurrencyCost.HasValue && _currentDailyWeapon.SoftCurrencyCost.HasValue) | |
{ | |
if( weapon.SoftCurrencyCost.Value < _currentDailyWeapon.SoftCurrencyCost.Value) | |
_currentDailyWeapon = weapon; | |
} | |
else | |
{ | |
if( weapon.BaseParams.Damage < _currentDailyWeapon.BaseParams.Damage) | |
_currentDailyWeapon = weapon; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment