Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

StackableBoard

  Asked By: Alex    Date: Jul 30    Category: Java    Views: 376
  

I've created a Board class that is a 2D array of objects. It's got
accessors, mutators, etc. Now I want to make a game where there are
certain obstacles, like rocks, where you can't go to that square, or
Board location. The rest of the squares, I want 10 people to go
there. I thought about extending Board to make a StackableBoard,
where each Board entry has an ArrayList. There will be a maxOccupancy
variable, which can be set to 10 for this example. My problem is, how
can I tell the game to allow 10 people to be on any square without an
obstacle like a rock, but not let anybody move to where there is a
rock? I want this to be reusable, so if maxOccupancy is 0 then there
will be no limit for the number of people per space, so making a rock
take up every element in the ArrayList wouldn't work.

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on StackableBoard Or get search suggestion and latest updates.




Tagged: