Quantcast
Channel: Programming (In-game)
Viewing all articles
Browse latest Browse all 645

Generic GetValue Option?

$
0
0
I have been trying to do something like the following:

Code:
myBlock.GetValue<T>(prop.Id);
Basically I want to be use GetValue on the property of a block without first knowing if its boolean, float so on.

Is this possible in Space Engineers?

Currently I am doing:
Code:
if (prop.TypeName == "Boolean")
	 myBlock.GetValue<Boolean>(prop.Id);
}
else if(prop.TypeName == "Float")
{
	myBlock.GetValue<float>(prop.Id);
}
Etc
It would be nice to have more a more compact way of doing...

Generic GetValue Option?

Viewing all articles
Browse latest Browse all 645

Trending Articles