Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant overload console command methods #2

Open
Seathus opened this issue Feb 25, 2021 · 1 comment
Open

Cant overload console command methods #2

Seathus opened this issue Feb 25, 2021 · 1 comment

Comments

@Seathus
Copy link

Seathus commented Feb 25, 2021

Looks like we can't overload command methods. Is this intended? Error is thrown when I attempt to do so:

ArgumentException: An item with the same key has already been added. Key: setspell
System.Collections.Generic.Dictionary2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) (at <9577ac7a62ef43179789031239ba8798>:0) System.Collections.Generic.Dictionary2[TKey,TValue].Add (TKey key, TValue value) (at <9577ac7a62ef43179789031239ba8798>:0)
Lim.InGameConsole.IGC_Main.GetMethods (System.Reflection.Assembly assembly) (at Library/PackageCache/com.limjoshua.igconsole@c7a5120089/Runtime/IGC_Main.cs:101)
Lim.InGameConsole.IGC_Main.Awake () (at Library/PackageCache/com.limjoshua.igconsole@c7a5120089/Runtime/IGC_Main.cs:45)

@JoshuaLim007
Copy link
Owner

Commands need to situated in a unique class name and a unique method name within the class because it's stored in a dictionary by name. So as of now there is no overloading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants