New Dawn
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Latest topics
» The good, the bad, and the ugly
Territory Creation EmptySun Jun 20, 2010 7:45 pm by Admin

» Events are happing
Territory Creation EmptyWed Apr 14, 2010 11:29 pm by Admin

» Progress! . . .
Territory Creation EmptyFri Apr 09, 2010 5:10 pm by Admin

» Soulmen(jordan)
Territory Creation EmptyWed Feb 24, 2010 7:56 pm by soulmen

» Basic starting blocks
Territory Creation EmptyWed Feb 24, 2010 7:41 pm by Admin

» Okay so uni isn’t so demanding as I first thought.
Territory Creation EmptyMon Oct 26, 2009 4:39 pm by Admin

» MP Architecture: Client/Server or Peer-2-Peer?
Territory Creation EmptySun Oct 04, 2009 2:34 pm by Daemn

» What I am working on at the Moment READ!
Territory Creation EmptyFri Sep 25, 2009 5:15 pm by Admin

» Development Framework available at SourceForge
Territory Creation EmptyTue Sep 22, 2009 9:46 am by Hairein

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Territory Creation

Go down

Territory Creation Empty Territory Creation

Post by Admin Tue Aug 18, 2009 6:15 pm

This would make accessing data for territories pretty straight forward.
If we had a few functions that in a .cpp and .h file. we could use this to access the data quickly. (In my opinion at least)

Code:
TERRITORY* list;
   
int Num_of_Territories;

// Another function would go here instead of this.
// Determined by StartOptions();
cin >> Num_of_Territories;
       
list = new UNIT[Num_of_Territories];
       
       
TERRITORY territory_land[Num_of_Territories];

      for(int i = 0; i < Num_of_Territories; i++)
      {
      territory_land[i].CreateLand ( --- Territory Data to go here --- );
      
// Data
// array or containors where the data is to be read from, will be increased here.
// This will arm the next territory to be created with the correct data.
      
GenerateLandByType(list, Num_of_Territories, territory_land, Num_of_Territories);
            
                          }

to increase the level of a building in territory 4 for example we would just need to do something like

Code:
list[3].Add_BuildingSlot_7(1);

this would increase the building in number 7 territory 4 towhatever it was before +1;
Thats the theory anyway.

Code:
list[3].Get_BuildingSlot_7();

Admin
Admin
Admin

Posts : 105
Points : 5632
Reputation : 3
Join date : 2009-07-16
Age : 34
Location : Wrexham, United Kingdom

https://spartanstudioforum.darkbb.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum