Compare commits
8
Commits
2661862d72
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e48842ee69 | ||
|
|
b1b71dc2ef | ||
|
|
a413f8ce5e | ||
|
|
bb816c52d8 | ||
|
|
7412f5678c | ||
|
|
9bd74275aa | ||
|
|
9f431517e3 | ||
|
|
c2bd24e383 |
@@ -1,7 +1,33 @@
|
|||||||
|
<div id="shields" align="center">
|
||||||
|
|
||||||
|
<!-- PROJECT SHIELDS -->
|
||||||
|
[![Contributors][contributors-shield]][contributors-url]
|
||||||
|
[![Forks][forks-shield]][forks-url]
|
||||||
|
[![Stargazers][stars-shield]][stars-url]
|
||||||
|
[![Issues][issues-shield]][issues-url]
|
||||||
|
[![MIT License][license-shield]][license-url]
|
||||||
|
[![Xing][xing-shield]][xing-url]
|
||||||
|
</div>
|
||||||
|
|
||||||
# CS:GO Fade Calculator Python
|
# CS:GO Fade Calculator Python
|
||||||
|
|
||||||
Attempted Python port of [@chescos](https://github.com/chescos) original
|
Python port of [@chescos](https://github.com/chescos) original
|
||||||
[csgo-fade-percentage-calculator](https://github.com/chescos/csgo-fade-percentage-calculator).
|
[csgo-fade-percentage-calculator](https://github.com/chescos/csgo-fade-percentage-calculator).
|
||||||
Check out his repository for more information.
|
Check out his repository for more information.
|
||||||
|
|
||||||
If you notice any errors please feel free to open an issue or do a pull request.
|
If you notice any errors please feel free to open an issue or pull request.
|
||||||
|
|
||||||
|
<!-- MARKDOWN LINKS & IMAGES -->
|
||||||
|
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
|
||||||
|
[contributors-shield]: https://img.shields.io/github/contributors/Helyux/csgo-fade-calculator-py.svg?style=for-the-badge
|
||||||
|
[contributors-url]: https://github.com/Helyux/csgo-fade-calculator-py/graphs/contributors
|
||||||
|
[forks-shield]: https://img.shields.io/github/forks/Helyux/csgo-fade-calculator-py.svg?style=for-the-badge
|
||||||
|
[forks-url]: https://github.com/Helyux/csgo-fade-calculator-py/network/members
|
||||||
|
[stars-shield]: https://img.shields.io/github/stars/Helyux/csgo-fade-calculator-py.svg?style=for-the-badge
|
||||||
|
[stars-url]: https://github.com/Helyux/csgo-fade-calculator-py/stargazers
|
||||||
|
[issues-shield]: https://img.shields.io/github/issues/Helyux/csgo-fade-calculator-py.svg?style=for-the-badge
|
||||||
|
[issues-url]: https://github.com/Helyux/csgo-fade-calculator-py/issues
|
||||||
|
[license-shield]: https://img.shields.io/github/license/Helyux/csgo-fade-calculator-py.svg?style=for-the-badge
|
||||||
|
[license-url]: https://github.com/Helyux/csgo-fade-calculator-py/blob/master/LICENSE
|
||||||
|
[xing-shield]: https://img.shields.io/static/v1?style=for-the-badge&message=Xing&color=006567&logo=Xing&logoColor=FFFFFF&label
|
||||||
|
[xing-url]: https://www.xing.com/profile/Lukas_Mahler10
|
||||||
+4
-5
@@ -1,9 +1,8 @@
|
|||||||
__author__ = "Lukas Mahler"
|
__author__ = "Lukas Mahler"
|
||||||
__version__ = "0.0.0"
|
__version__ = "1.0.0"
|
||||||
__date__ = "26.06.2023"
|
__date__ = "12.07.2023"
|
||||||
__email__ = "m@hler.eu"
|
__email__ = "m@hler.eu"
|
||||||
__status__ = "Development"
|
__status__ = "Production"
|
||||||
|
|
||||||
|
|
||||||
from src.FadeCalculator import FadeCalculator
|
from src.FadeCalculator import FadeCalculator
|
||||||
from src.AmberFadeCalculator import AmberFadeCalculator
|
from src.AmberFadeCalculator import AmberFadeCalculator
|
||||||
@@ -15,7 +14,7 @@ def main():
|
|||||||
Showcasing example usage
|
Showcasing example usage
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Create an instances of the calculators
|
# Create instances of the calculators
|
||||||
fade_calc = FadeCalculator()
|
fade_calc = FadeCalculator()
|
||||||
amber_calc = AmberFadeCalculator()
|
amber_calc = AmberFadeCalculator()
|
||||||
acid_calc = AcidFadeCalculator()
|
acid_calc = AcidFadeCalculator()
|
||||||
|
|||||||
+44
@@ -0,0 +1,44 @@
|
|||||||
|
__author__ = "Lukas Mahler"
|
||||||
|
__version__ = "1.0.0"
|
||||||
|
__date__ = "18.07.2023"
|
||||||
|
__email__ = "m@hler.eu"
|
||||||
|
__status__ = "Production"
|
||||||
|
|
||||||
|
import json
|
||||||
|
|
||||||
|
from src.FadeCalculator import FadeCalculator
|
||||||
|
from src.AmberFadeCalculator import AmberFadeCalculator
|
||||||
|
from src.AcidFadeCalculator import AcidFadeCalculator
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
"""
|
||||||
|
Generate static .json files, this is different from the original typescript repository.
|
||||||
|
I like this .json format more for accessing the seeds later.
|
||||||
|
e.g. ['AWP]['42']['percentage'] where 42 is the seed.
|
||||||
|
"""
|
||||||
|
|
||||||
|
# Create instances of the calculators
|
||||||
|
fade_calc = FadeCalculator()
|
||||||
|
amber_calc = AmberFadeCalculator()
|
||||||
|
acid_calc = AcidFadeCalculator()
|
||||||
|
|
||||||
|
# Build a new dict using format [WEAPON][SEED] = seed, percentage, ranking
|
||||||
|
for calc, name in [(fade_calc, 'fade'), (amber_calc, 'fade_amber'), (acid_calc, 'fade_acid')]:
|
||||||
|
rebuild = {}
|
||||||
|
for obj in calc.get_all_fade_percentages():
|
||||||
|
rebuild[obj.weapon] = {}
|
||||||
|
for subobj in obj.percentages:
|
||||||
|
rebuild[obj.weapon][subobj.seed] = {
|
||||||
|
'seed': subobj.seed,
|
||||||
|
'percentage': subobj.percentage,
|
||||||
|
'ranking': subobj.ranking
|
||||||
|
}
|
||||||
|
|
||||||
|
# dump the new dicts to a json file using 4 indents under ./generated
|
||||||
|
with open(f"./generated/{name}.json", 'w') as jf:
|
||||||
|
json.dump(rebuild, jf, indent=4)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
+125082
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,9 +1,8 @@
|
|||||||
__author__ = "Lukas Mahler"
|
__author__ = "Lukas Mahler"
|
||||||
__version__ = "0.0.0"
|
__version__ = "1.0.0"
|
||||||
__date__ = "26.06.2023"
|
__date__ = "12.07.2023"
|
||||||
__email__ = "m@hler.eu"
|
__email__ = "m@hler.eu"
|
||||||
__status__ = "Development"
|
__status__ = "Production"
|
||||||
|
|
||||||
|
|
||||||
from src.BaseCalculator import BaseCalculator
|
from src.BaseCalculator import BaseCalculator
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
__author__ = "Lukas Mahler"
|
__author__ = "Lukas Mahler"
|
||||||
__version__ = "0.0.0"
|
__version__ = "1.0.0"
|
||||||
__date__ = "26.06.2023"
|
__date__ = "12.07.2023"
|
||||||
__email__ = "m@hler.eu"
|
__email__ = "m@hler.eu"
|
||||||
__status__ = "Development"
|
__status__ = "Production"
|
||||||
|
|
||||||
|
|
||||||
from src.BaseCalculator import BaseCalculator
|
from src.BaseCalculator import BaseCalculator
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
__author__ = "Lukas Mahler"
|
__author__ = "Lukas Mahler"
|
||||||
__version__ = "0.0.0"
|
__version__ = "1.0.0"
|
||||||
__date__ = "28.06.2023"
|
__date__ = "12.07.2023"
|
||||||
__email__ = "m@hler.eu"
|
__email__ = "m@hler.eu"
|
||||||
__status__ = "Development"
|
__status__ = "Production"
|
||||||
|
|
||||||
|
|
||||||
from src.RandomNumberGenerator import RandomNumberGenerator
|
from src.RandomNumberGenerator import RandomNumberGenerator
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
__author__ = "Lukas Mahler"
|
__author__ = "Lukas Mahler"
|
||||||
__version__ = "0.0.0"
|
__version__ = "1.0.0"
|
||||||
__date__ = "26.06.2023"
|
__date__ = "12.07.2023"
|
||||||
__email__ = "m@hler.eu"
|
__email__ = "m@hler.eu"
|
||||||
__status__ = "Development"
|
__status__ = "Production"
|
||||||
|
|
||||||
|
|
||||||
from src.BaseCalculator import BaseCalculator
|
from src.BaseCalculator import BaseCalculator
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
__author__ = "Lukas Mahler"
|
__author__ = "Lukas Mahler"
|
||||||
__version__ = "0.0.0"
|
__version__ = "1.0.0"
|
||||||
__date__ = "26.06.2023"
|
__date__ = "12.07.2023"
|
||||||
__email__ = "m@hler.eu"
|
__email__ = "m@hler.eu"
|
||||||
__status__ = "Development"
|
__status__ = "Production"
|
||||||
|
|
||||||
|
|
||||||
import math
|
import math
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user