Sunday, 25 September 2016

This did it.

So now there are two fairly well controlled places where the map.cs looks for other variables to work with.
I couldn't find a way to do it in one step.  Not saying that it can't be done, just that I couldn't figure it out.
Basically I have:
 - "new map" sends some info to define the size of the map to make
- it then says, here have an array fill it with stuff.
- then internally to the map creator it fills in the array
- then map creator sends back an array

Effectively I've gone from 20+ lines calling on 'global' variables over 150 ish lines of code, to zero explicit calls to the globals.  Just a couple function/method calls, which are much easier to change later.  Also means I can tweak the map generator without having to redo masses of cross links.

No comments:

Post a Comment