Results 1 to 4 of 4
Thread: Flowchart, Repition
Nov 9, 2009, 05:10 #1
Im trying to figure out how to share the "new User" functions
with the "Enemy", rather than duplicating them..
Ive gone through my mind so much how to lay this stuff out but now
its getting very messy. And I would like to ask anyone for any advice before I drive myself crazy.
I wish there were a way to Implement functions into an object without instantiating it.
I also wish that if I am in User, and its instantiated in App, that I could call anything from App inside of User even if its not extended.
Nov 9, 2009, 08:12 #2
- Join Date
- Jan 2005
- 0 Post(s)
- 0 Thread(s)
what's the difference between user and enemy? I not sure what your doing cause your post doesn't make all that much sense. However, if enemy is just a relationship between two user objects then you don't have to worry about creating some additional functionality to get access user object methods or properties.Creativity knows no other restraint than the
confines of a small mind. - Me
Oh baby! Check out the design patterns on that framework!
Nov 9, 2009, 09:07 #3
The User and Enemy are both real players,
Enemy only gets a little bit of information the same as users.
I didnt know if i should try abstract or an interface to make it clearer..
I dont see very many examples of what people make and the best way to go about it.
So I am trying to make it up logically as I go without abusing too much repetition.
Nov 9, 2009, 09:52 #4
I think I found a solution
protected function GetUserInfo()
// Process Methods
// All these methods defined below
class MyCharacter extends User
// Compile the Character
// New Objects for Procedures and Setup
$this->Action = new Action($this);
$this->Inventory = new Inventory();
$this->Bar = new Bar($this);
class Enemy extends User