carmineos / rage-toolkit

Other
19 stars 6 forks source link

Refactor ResourceSimpleArray #24

Open carmineos opened 3 years ago

carmineos commented 3 years ago

ResourceSimpleArray currently inherits from ListBase which has a workaround to cache block length. This actually isn't required as covariance isn't a problem in this case because ResourceSimpleArray is never used with blocks of type IResourceXXSystemBlock or blocks of variable length (except in ShaderParametersBlock_GTA5_pc which uses is temporary but won't use it anymore once IPackedBlock interface is implemented)

This means that we can be sure that block length is always Count * BlockLength of T We should also consider refactoring all the base collections blocks to implement common .NET collections interfaces.