Commit graph

38 commits

Author SHA1 Message Date
Kurt
c5ebbbbe15 Minor clean
Magic number -> const usage
default(T) -> default (c#7.x feature)
remove some unused stuff
fix indentation in some spots
2019-09-10 22:07:50 -07:00
Kurt
cbd039b18c Extract datasource filtered lists to object
GameInfo has been the storage for the current Game Language environment
When using GameInfo, only one environment is tracked at a time, which is
initialized by the PKM editor (items, moves). Rework things to allow
multiple filtered sources to exist, and keep the filtering logic in
PKHeX.Core for reuse in other programs... ;)
2019-06-22 10:50:32 -07:00
Kurt
de774ed131 readonly ComboItem
create once, never modified after
2019-06-01 19:12:41 -07:00
Kurt
520c9da5c9 Update string loading
Remove usage of linq for sorting, use array.sort for in-place sorting.
Wasteful creating temp sorted buffers then enumerating them to dump into
the list.
2019-04-29 21:55:43 -07:00
Kurt
fad5e4bdee Expand comboitem loading for simple cases
slightly less gc pressure, precompute capacity
2019-03-18 21:55:33 -07:00
Kurt
82a40cb965 Misc updates
add comboitem list to string[]
add regions list as cached comboitem list
lock resource cache on fetch
extract alola time list generating
2019-03-18 21:34:21 -07:00
Kurt
202f911d45 Tidy up comboitem fetch naming 2019-02-15 11:47:35 -08:00
Kurt
383d4b7700 "" -> string.Empty
be explicit that the string is empty rather than possibly missing
disallow encrypted export for BK4 (they're not encrypted), removes type
check
simplify replaceall in showdownset (don't call ReplaceAll 4x, just get
valid chars and rebuild)
simplify get ribbon sprite name (precompute ToLower and appended values
2019-02-07 21:40:20 -08:00
Kurt
29253ed636 More cleaning 2019-02-03 20:28:03 -08:00
Kurt
6ed9f979de Continued refactoring
removing null results as indicators of no data (c# 8 sooooon)
2019-02-01 23:26:43 -08:00
Kurt
aa022fad40 Misc refactoring
remove some null usages, return an empty array instead
reduce as arg
2019-02-01 23:08:03 -08:00
Evan Dixon
9c87ad2977 Port tests to .Net Core (#2156)
* Rewrite tests with XUnit and .Net Core
* Add better "because" message
* Skipping test that was not ready & convert the fact to a theory
* Tweak casing
* Convert select date tests to theories
* Make the GetStringList load lock safer
2018-11-06 15:25:35 -08:00
Kurt
cc20bb38d7 misc updates
use arrays instead of list when capacity known
use enums for const decoration
remove unnecessary aliases
2018-09-01 19:55:08 -07:00
Kurt
f4bfdb8311 Remove unnecessary empty array allocations
yay net 4.6
read more: http://justinvp.com/2015/07/20/array-empty/
2018-08-01 18:30:51 -07:00
Kurt
d916be1020 Style updates 2018-07-29 13:27:48 -07:00
Kurt
9f8edc89bf Refactoring
put some string[] behind IReadOnlyList to prevent any consumer from
modifying it
2018-06-30 09:59:48 -07:00
Kurt
d724dffcc3 Update translations
Add secret debug hotkey to trigger update of translation files
2018-05-31 22:40:55 -07:00
Kurt
dbb23f33c8 Update trim call for strings
7ef8a88678 (commitcomment-29123689)

A better fix may be to just make all line endings consistent ('\n'), but
string resource loading time is negligible
2018-05-24 21:16:55 -07:00
Kurt
99005d8fc0 Refactoring
more discards & simplifications
2018-05-12 12:28:48 -07:00
Kurt
5a3c8f4147 Remove trailing whitespace 2018-05-12 08:41:29 -07:00
Kurt
6ac8ed0098 Update translations
all supported langs now have all 3 translatable resources; translate
away!
2018-04-08 09:19:19 -07:00
Kurt
5bc2e6da88 Refactoring
de-linq some areas where direct accessing is possible (list/array)
2017-12-04 20:16:54 -08:00
Kurt
b8a5657d5a misc tweaks
pull out transfer locations to const references
add vc2 & crown beast/celebi met location suggesting
add vc2 crystal sensitive detection
add 2 more usum trainer stats (thanks holla!)
2017-11-22 21:45:30 -08:00
Kurt
9af0876352 clone cached string resources
don't share object references, need to be passed as new copies as the
array contents can be modified

need to clone on dict return to not pollute dict, and need to clone
after dict add so that the first return doesn't equal the dict copy --
this one could be on the dict add... keep returns same.
2017-11-07 17:12:04 -08:00
Kurt
d7300ce68f Cleanup
add amoongus route22 encounter
fix typos in comments
resharper suggestions for recent pr
2017-11-02 21:37:28 -07:00
Evan Dixon
7ac1a4c6df Cache resource name => manifest resouce name mapping 2017-11-01 21:47:55 -05:00
Evan Dixon
133a19a468 Fix fallback from unlocalized language file to default language 2017-11-01 21:44:35 -05:00
Evan Dixon
81e87c1a15 Change the concurrent dictionary to a dictionary
It'd be nice to be thread-safe, but I don't really expect multithreaded applications to be calling this method a lot, and I'd imagine the concurrent version has more overhead
2017-11-01 21:42:12 -05:00
Evan Dixon
29ce9a347b Cache retrieved data to improve execution speed 2017-11-01 21:34:01 -05:00
Evan Dixon
9e980f4a1d Use manifest resources for string lists instead of the resources file 2017-10-23 13:18:44 -05:00
Kurt
43d1c7740f add event flag localization
rename files for english indication
allow script text retrieval with current language

simplify resource retrieval a little
2017-10-11 20:00:18 -07:00
Kurt
32bbd2cee0 old cleanup
revisit comboitem providing, simplify some methods with fancy linq
probably faster as there's no use of dictionaries and Array.IndexOf
after sorting, as the values are kept with the text.
2017-09-30 01:07:30 -07:00
Kurt
1e377c2963 interpolation++
no functional change (assumed)
2017-09-29 22:58:25 -07:00
Kurt
cb8777f767 Refactoring
now that the logic has become more stable, polish away some complexity
2017-07-29 11:54:52 -07:00
Kurt
4e9b6be8e5 Convert console output to debug output
output messages are now no longer in release builds, as they are only
visible when debugging in an IDE.
2017-07-01 19:43:51 -07:00
Kurt
3f38b123a3 Refactoring
mostly renaming things, includes a little bit of added sugar and
splitting methods to simplify the codebase.

all methods are now PascalCase
2017-06-17 18:37:19 -07:00
Kurt
aeb90d262c Cleanup 2017-05-12 09:33:12 -07:00
Evan Dixon
52c4fbbe97 Converted PKHeX.Core to .Net Standard
Refactored and rearranged things as needed to allow the change
2017-05-11 23:34:18 -05:00
Renamed from PKHeX/Util/DataUtil.cs (Browse further)