Thread: Buddy Game
View Single Post
Old 11-08-2012, 06:04 PM   PM User | #5
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,645
Thanks: 4
Thanked 2,450 Times in 2,419 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Activity base definition like so:
PHP Code:
public class Activity
{
    private 
String sActivityName;
    private 
int iChangeConditionBy;

    
// add constructors and base methods.  Then implement:
    
public void performActivity(Buddy b); // give Buddy object a method to modifyConditionBy(int)
    // OR
    
public int modifyConditionBy(); // handled in Buddy object instead

The main class should be responsible for assigning the menus itself. Whether it be numbers or textual on first letter based; checking the Activity and pulling the activity name out will give you what you need. Start with numbers as its easier, then do the string (which is why you should let the main deal with this).

Also, in the future please wrap code with [php][/php] or [code][/code] tags as it preserves the formatting.

Activity wise, I wouldn't pet or sleep my shovel. I'd store and. . . stroke it. lol.

Edit:
Actually, noting the phrases used here for the activities, make activity like so:
PHP Code:
public class Activity
{
    private 
String sActivityname;
    private 
int iModifyCondition;
    private 
Buddy buddy;

    
//. . .
    
public void modifyCondition();

You'll need Buddy's name for a part of the activity name.

Last edited by Fou-Lu; 11-08-2012 at 07:03 PM..
Fou-Lu is offline   Reply With Quote