Conversation
|
Interesting, we aren't supporting multiple inheritance levels, we must fix it. |
| /// <returns><see langword="true"/> if the object instance is not null and can be casted as the specified type; otherwise, <see langword="false"/>.</returns> | ||
| // @nao It will return the Instance. | ||
| // But with this curent class definition you can register derived class of T. | ||
| // They can be registred but not retrived. Also why make this method generic if this not to get |
There was a problem hiding this comment.
I was high writing most of this code
| values ??= new(); | ||
| TypeCode code = Convert.GetTypeCode(typeof(TSource).GetField("MinValue").GetValue(null)); | ||
|
|
||
| // @Nao If the value is not an Uxxxxx it will get an overflow. Like if it use an Int16, Byte or SByte |
| Value = value; | ||
|
|
||
| // @nao If the value is register when a new instance is created. | ||
| // Maybe put the ctor in protected to avoid exteranal code (outisde the enum) to create new values |
There was a problem hiding this comment.
internal protected can be cool if Exiled need to create dedicated new instance in an helper class
| return; | ||
| } | ||
|
|
||
| // @Nao, it cool to use the event system for this. But if an other plugin |
nixkrystik
left a comment
There was a problem hiding this comment.
I'm gonna ignore the Grade 12 spelling.
|
I do not get the point of TypeCastObject do the C# default I know that implementing cast operators don't allow Is it to do runtime editable castable object ? If yes, where do you need this ? I do not see an usage of ITypeCast in any method. And the class using TypeCastMono and TypeCastObject only use the |
The code has been simplified to no longer use a dictionary to manage multiple instances of `Singleton<T>`. Now a single instance of `T` is used via a static `Instance` property. The `Create` method has been changed to set the instance if it is not already set, and a new `Destroy` method has been added to reset the instance to `null`. The `TryGet` and `Destroy` methods have been simplified to work with the new single instance implementation. The calls to `Singleton<VirtualPlugin>.Create(this)` and `Singleton<VirtualPlugin>.Destroy(this)` in `VirtualPlugin.cs` have been commented out, with annotations suggesting that use of the class itself as a singleton might require a different approach to avoid overwriting other instances.
|
@NaoUnderscore I rewrite the Singleton, are you ok ? |
That's a way to make everything more versatile, so we can safely define our own |
Go ahead, I've made some changes to |
The code has been simplified to no longer use a dictionary to manage multiple instances of `Singleton<T>`. Now a single instance of `T` is used via a static `Instance` property. The `Create` method has been changed to set the instance if it is not already set, and a new `Destroy` method has been added to reset the instance to `null`. The `TryGet` and `Destroy` methods have been simplified to work with the new single instance implementation. The calls to `Singleton<VirtualPlugin>.Create(this)` and `Singleton<VirtualPlugin>.Destroy(this)` in `VirtualPlugin.cs` have been commented out, with annotations suggesting that use of the class itself as a singleton might require a different approach to avoid overwriting other instances.
…mClass, UniqueUnmagedEnumClass and EnumClass if a IComparable class i needed the Comparer<ExiledEnumClass>.Default provide one.
|
I no longer have time to work on this project. |
I don't want to impose my decisions. But, I want this to be change or at least be heard.
Some stuffs seem to me to have been rushed. So i added comamnt and do litle edition.
I don't know how you prefer to resolve the problem. So i pointed them with comment for the most.
Why not discord:
Discussions here will be easier than discord to keep up with change.
I also try to use the new Enum. But realy i do not get who it work.
When I fold the code, it seems to me that there is an error in the management of super classes.
And when i try, This isn't working, I don't know if it's me or the code. So I place my experiences here:
Interactive Test