JECS icon indicating copy to clipboard operation
JECS copied to clipboard

Do a big refactor of everything

Open JimmyCushnie opened this issue 4 years ago • 3 comments

The core of this project was written when I was a much less seasoned programmer, and SUCC as a whole is not up to my current standards of code quality. Todo, at some point: refactor the whole damn thing.

JimmyCushnie avatar Jul 20 '20 08:07 JimmyCushnie

In particular, good lord BaseTypes needs to be split up into a dozen smaller classes. I started doing this with TypeStrings (d0b2647), but it needs to come to the rest of the base types, ideally with some nice abstraction for classes with base type logic.

This will be absolutely necessary if we add complex arithmetic parsing for float types (#28)

JimmyCushnie avatar Sep 14 '20 15:09 JimmyCushnie

Another notable space where code should be improved: instead of hardcoding which collection types are supported (currently Array, List<T>, HashSet<T>), implement an abstract solution that uses ICollection or something. (Though we'll still need special code for Dictionaries)

JimmyCushnie avatar Sep 14 '20 15:09 JimmyCushnie

Oh yeah, also we really need a common interface for ReadOnlyDataFile and DistributedData, like ISuccDataContainer. Probably most of the methods, like GetAsDictionary, can be abstracted to extension methods on that interface.

JimmyCushnie avatar Sep 18 '20 00:09 JimmyCushnie