I have a bunch structure arrays like listed below that Id like to port over to C#. This is a part of a big project. How can I easily achieve something like this in C# ? Such as grouping variables ? I know a class will do but to do something like this Id perhaps have to create a number of nested classes ?
robot.task.mapBuilding.exploration.isExploring = 0;
robot.task.mapBuilding.exploration.initialiseAreaExploration = 1;
robot.task.mapBuilding.exploration.isInExplorationArea = -1;
robot.task.mapBuilding.exploration.lists.canRequestNewTask = 1;
robot.task.mapBuilding.exploration.lists.requestNewTask = [];
robot.task.mapBuilding.exploration.lists.receivedNewTask = [];
Thanks in advance
I don’t know anything about matlab, but based on what you have shown above you could have a class library with a
robot.task.mapbuildingnamespace but it would require some classes and nested as you say.For example an
explorationclass that contains alistsclass:edit
If you’re not bothered about value validation or initialisation on construction then this could be wittled down to:
Note that I’ve kept to the property naming convention of starting with capitals, although I haven’t done so with the classes (which I suppose I should have done really).