I was refering to the suggestions made by other users on how to write the system.
Ill just write a bit about OOP for the benifit of anyone reading this thread:
Classes should really define a single "thing" with that object having methods, typically verbs, that relate to that single thing.
Lets take a rather simple example. We're making a simple war game and we have different units. One unit might be a tank and the other might be a fighter jet. There would be two different classes for both the tank and the fighter jet e.g
Now, the tank can fire its cannon or fire its machine guns, so we might have:PHP Code:class tank {
/* Functions.. blah... blah */
}
class jet {
/* Functions.... */
}
Similar setup for the jet, it can fire its missiles or guns.PHP Code:class tank {
public function fireCannon($target) {
/*code*/
}
public function fireGuns($target) {
/*code*/
}
}
We would not do something like:
Where the army object controls the entire game and just stores the data internally and each unit is identified by a ID (1 in this case). Although we might use an army object that stores the other unit objects and creates them (This is called a factory pattern).PHP Code:$army->fire("tank", "guns", 1);





. 

Reply With Quote





diddoms. i think mentor can cope with coding by himself without a accidental backdoor contribution by you. stick to the testing, good boy.
