Latest topics
» The good, the bad, and the ugly
Sun Jun 20, 2010 7:45 pm by Admin

» Events are happing
Wed Apr 14, 2010 11:29 pm by Admin

» Progress! . . .
Fri Apr 09, 2010 5:10 pm by Admin

» Soulmen(jordan)
Wed Feb 24, 2010 7:56 pm by soulmen

» Basic starting blocks
Wed Feb 24, 2010 7:41 pm by Admin

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

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

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

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

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Renaming playerResources class

Go down

Renaming playerResources class

Post by jsmoore82 on Thu Jul 30, 2009 12:37 am

Hey everyone, just curious what does everyone thing about modifying the playerResource class to just Resources?

Working with it I realized that its really just a smart struct but can be used by any subscriber rther than just players.
i.e. Players have resources
buildings have cost in resources
Research has cost in resources

Everywhere resources are used it is in the same format.

I know this seems trivial now, but I am thinking of down the road development as more classes come online. It will be easier to change the few we have now.
avatar
jsmoore82
Regular
Regular

Posts : 46
Points : 3327
Reputation : 1
Join date : 2009-07-25
Age : 35
Location : Spokane, WA

View user profile

Back to top Go down

Re: Renaming playerResources class

Post by Admin on Thu Jul 30, 2009 1:01 am

fair enough, go ahead.
did you get my post about adding research requierments to your building class?

Admin
Admin
Admin

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

View user profile http://spartanstudioforum.darkbb.com

Back to top Go down

Re: Renaming playerResources class

Post by jsmoore82 on Thu Jul 30, 2009 1:10 am

yes I did, right now cleaning up and commenting what I submitted yesterday and then plan on adding that here shortly.

Took a look at the research code. Did we want to make it a stand alone class or is it actually inheirting from building, thus underneath the hood, research objects are special buildings?
avatar
jsmoore82
Regular
Regular

Posts : 46
Points : 3327
Reputation : 1
Join date : 2009-07-25
Age : 35
Location : Spokane, WA

View user profile

Back to top Go down

Re: Renaming playerResources class

Post by Admin on Thu Jul 30, 2009 1:47 am

No a seperate class. Although I did think about it.

I think it would be easier to keep them seperate to avoid confusion. Depending on how research is undertaken we may need to add functions that wouldn't be specific for buildings.

We will also need to seperate research from buildings when writing the files for different Nations, to make reading in data easier.

Whichever works best, this is just my opinion.

Admin
Admin
Admin

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

View user profile http://spartanstudioforum.darkbb.com

Back to top Go down

Re: Renaming playerResources class

Post by jsmoore82 on Thu Jul 30, 2009 1:51 am

Alright, so if research is an object then all I should have to do is port it in as a variable into building and place the usual set/get with it.

buildings should not have to know research behaviors and attributes just basic interface.
avatar
jsmoore82
Regular
Regular

Posts : 46
Points : 3327
Reputation : 1
Join date : 2009-07-25
Age : 35
Location : Spokane, WA

View user profile

Back to top Go down

Re: Renaming playerResources class

Post by Admin on Thu Jul 30, 2009 2:03 am

Yeah, exactly the same as you did for the BuildingsNeeded, thats all I think

Admin
Admin
Admin

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

View user profile http://spartanstudioforum.darkbb.com

Back to top Go down

Re: Renaming playerResources class

Post by jsmoore82 on Thu Jul 30, 2009 2:24 am

sorry connection timed out and didn't realize it til was in the middle of submitting.

Re: Renaming playerResources class
jsmoore8 Today at 12:23 am

.so there is going to be a limited number of resource topics? The int array for the buildings was a cheap way of storing just the level and building resources knowing that there were going to be only so many buildings and they were going to level up, but still be the same building. How are we pe-evisioning the resource tree, is it going to be like metal refining group and then have different levels of refinement or is each going to be a seperate like gunpowder and advance math with all of them being single resource topics that don't follow a level up design?
avatar
jsmoore82
Regular
Regular

Posts : 46
Points : 3327
Reputation : 1
Join date : 2009-07-25
Age : 35
Location : Spokane, WA

View user profile

Back to top Go down

Re: Renaming playerResources class

Post by Admin on Thu Jul 30, 2009 9:56 am

whichever we can get done, stick with the lvl up system for now

Admin
Admin
Admin

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

View user profile http://spartanstudioforum.darkbb.com

Back to top Go down

Re: Renaming playerResources class

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

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