Skip to content

Modernize the codebase w/ Fixes & Optimizations #2

@kamronbatman

Description

@kamronbatman

Updates the codebase to the newest code paradigms and standards. This includes:

  • Using string interpolations
  • Removing default value initialization
  • Merging sequential checks
  • Using ?? (null coalescing) instead of ternary
  • Using null propagation where possible
  • Removing unused namespaces
  • Using arrow body expressions for properties where applicable
  • Using automatic property initializers
  • Removing redundant initializers including delegations
  • Removing implicit this
  • Using constructor initializers
  • Use type casting variables to stop double casting
  • Remove overloading in favor of default value parameters
  • Replace ArrayList, HashTable, and object[] states with typed collections.
  • Use in-line out variable declaration
  • Optimize the spell system by introducing a singular SpellTarget object and making all spells children of a TargetingSpell class. This reduces the number of internal target types and reuses code.
  • Optimize GetEntities (GetItems[InRange] and GetMobiles[InRange]) to use generics where possible
  • Update GetRegion to use generics
  • Replace callbacks with object states with lambda curries
  • Remove Timer.DelayCall generic TimerStateCallback in favor of lambdas/closure/curries

In Progress:

  • Remove overloading in favor of named parameters
  • Optimize GetEntities to take a flexible set of predicates so that items/mobiles are filtered in the LINQ
    • e.g. Extending SelectItems, SelectMobiles, SelectMultis, etc

PRs:
#1 - Updates code formatting, style, fixes various small bugs, and changes casts/type checks to use pattern matching
#3, #37- Updates out variables, adding items with optional parameters in ctor, and makes functions that take typeof variables use generics.
#7 - Fixes Dictionary uses throughout repo
#14 - More cleanup
#18 - Collapsing more null checks and removing overloading constructors
#31 - Fix comparables
#36 - Cleans up SpellTargeting

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions