ark-mod / ArkSavegameToolkitNet

Library for reading ARK Survival Evolved savegame files using C#.
MIT License
21 stars 27 forks source link

Game- and cluster-update methods should not depend on class name matching #1

Open tsebring opened 6 years ago

tsebring commented 6 years ago

Change game and cluster update methods not to depend on game object identification flags that are set based on full or partial class name matching.

Game objects contain little information to tell us what kind they are, guessing based on class name will always be required but should be minimized to improve compatibility with mods.

Code

var statusComponents = objects.Where(x => x.IsDinoStatusComponent).ToDictionary(x => x.ObjectId, x => x);

Should be

var statusComponents = objects.Where(x => x.IsStatusComponent).ToDictionary(x => x.ObjectId, x => x);
// or...
var objectMap = objects.ToDictionary(x => x.ObjectId, x => x);

etc.