View Single Post
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 12-30-2016 , 00:42   Re: New API and Syntax
Reply With Quote #829

Is it possible to do static properties in methodmaps?

Eg:

Code:
static int s_CollectionSize = 0;

methodmap BaseCollection
{
	public BaseCollection()
	{
		return view_as<BaseCollection>(0);
	}

	static property int Size
	{
		public get()
		{
			return s_CollectionSize;
		}
		public set(int value)
		{
			s_CollectionSize = value;
		}
	}
}
I wish to be able to do the below without having to make an methodmap instance.

Code:
BaseCollection.Size = 666;
PrintToServer("BaseCollection.Size=%d", BaseCollection.Size);
__________________

Last edited by Neuro Toxin; 01-01-2017 at 20:39.
Neuro Toxin is offline