Enum Structs Available This Holiday Season
Hi Folks,
As of PR #934, SourceMod 1.10 has support for enum structs. This is some long-overdue syntactic sugar that makes SourcePawn feel more like a real language. Enum Structs are internally implemented as arrays, but the syntax is a lot nicer than before and we've fixed a lot of the corner cases and rough edges around using them. You can also have enum struct methods now. You can read more about enum structs either in the Transitional Syntax Docs, or in the commit message. If you're too impatient to read that, I'll just copy and paste the sample code from the doc: PHP Code:
|
Re: Enum Structs Available This Holiday Season
Like a breath of fresh air. Well done!
|
Re: Enum Structs Available This Holiday Season
I really appreciate this!
but looks like latest mac compiler can't compile this expression...? |
Re: Enum Structs Available This Holiday Season
If I ever get around to working on it again, this will greatly simplify some the code to a plugin I was working on to replace the aging UMC plugin.
|
Re: Enum Structs Available This Holiday Season
All this sugar is pretty epic. Already added support to BasicPawn.
Lets hope we dont get diabetes :lol: |
Re: Enum Structs Available This Holiday Season
Looks great but why 'enum' is needed its seems like c struct
|
Re: Enum Structs Available This Holiday Season
Because it's still just syntactic sugar over arrays, just like old enum structs, but with nicer syntax.
|
Re: Enum Structs Available This Holiday Season
Quote:
Edit: Also text document because I'm too lazy to use a UML diagram maker to do it. |
Re: Enum Structs Available This Holiday Season
Is there a way we can push enum structs with array fields in them into an ArrayList? For example,
PHP Code:
Code:
Start |
Re: Enum Structs Available This Holiday Season
Seems like a bug to me. You should open an issue on the github page: https://github.com/alliedmodders/sourcepawn/issues
|
All times are GMT -4. The time now is 22:08. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.