fyziktom / VirtualEconomyFramework

Framework for economy applications
https://veframework.com/
MIT License
24 stars 7 forks source link

Create interface for accounts in the VEDriversLite #33

Open fyziktom opened 2 years ago

fyziktom commented 2 years ago

We need to add the interface for the account classes (NeblioAccount and DogeAccount) same as it is in the VEDrivers.

This task will also considering some refactoring of the NeblioAccountBase.cs class which will be partially merged with the base interface which will cover the common properties and functions from the both actual Account classes.

we should do this refactoring before some bigger refactoring of the blazor components (it simplify lots of them).

fyziktom commented 2 years ago

I have moved forward with this. I am working on this issue in the branch .

I have created the IAccount interface and few other related things. Now I am working on the INFTModules to split the Accounts to the smaller parts related to the NFTs functionalities. More below.

Now the basic sequence chart for the loading of the account. It shows load of the account, two NFT modules and then process the NFT Order:

Here is the basic structure of the classes:

fyziktom commented 2 years ago

In this commit you can find the first version of the INFTModule and four implementations.

First is CommonNFTModule which cover the reloading of the NFTs. The function is virtual so it is possible to override it in real implementations such as VENFTModule, where I added the list of allowed to load types of NFTs for this Module.

This test run the new Neblio Account class based on IAccount interface. It will load three NFT Modules automatically (VENFTModule, ShopNFTModule, MessageNFTModule).