Page 1 of 1

Multiple Maps

Posted: Sat Jan 19, 2008 5:35 am
by Grimdoomer
Im making a app for Halo 2 Xbox and I need to have multiple maps open at once. I have a seperate class for everything ex Header, Index, Tags, StringID's ecy. Then I have them all link togather with a class called map, so I can quickly call to them ex Map.Header.MapName. But when I looked at Entity's source they have everything in one giant class. I dont want this for a cuple reason but mainly it is not neat. Im aiming for around 5 maps open at teh same time. I mean who would honestly have 5 maps open. So I really dont know how to start this. Can some one help?

Multiple Maps

Posted: Sat Jan 19, 2008 5:44 am
by JacksonCougar
At times I will have 10+ maps open in Entity.

Multiple Maps

Posted: Sat Jan 19, 2008 11:05 am
by Prey
It's simple: You have your 'mapform' which is the form that appears when someone selects a map.. so just initialise an instance of your 'map' class inside it... that way each 'mapform' has a 'map' containing all the info related to the map opened on that form.

Multiple Maps

Posted: Sat Jan 19, 2008 1:47 pm
by KIWIDOGGIE
Also, If you can use a MDI container with the h2map.X being able to be used on diffrent threads; try that Because it should still handle what you want without interfearing with other threads. But be careful because threading is a bitch :P

Multiple Maps

Posted: Sat Jan 19, 2008 3:13 pm
by Grimdoomer
I know about the MDI containers and all, what I dont get is when I do something in map 2, whats gunna stop it from doing it in map 1? So my real question is where do I get the map number?

Multiple Maps

Posted: Sat Jan 19, 2008 6:00 pm
by Prey
No definitely don't use threading for this..

Every map opened opened has it's own form, right? So just just put whatever is specific to that map, on the form. Like I said above..

In Entity's case, the maps were stored off in a list accessible from anywhere, and then the mapforms each contained the index at which their map was.

Multiple Maps

Posted: Sat Jan 19, 2008 6:21 pm
by Grimdoomer
Ok I got it now thanks.

Multiple Maps

Posted: Sat Jan 19, 2008 7:45 pm
by Supermodder911
Yea Prey's right. Thats another reason entity's Coding is crap.
Just put whatever you need in you map form and it will only be called by the form that calls it not the other mapform.