Class Inheritance: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Class Inheritence moved to Class Inheritance: corr. spelling)
(Improved formatting.)
Line 3: Line 3:
i am just getting some ideas down on how to explain
i am just getting some ideas down on how to explain


*the necessity of requiredaddons=  aka the pbo loading order
*the necessity of requiredAddons[]=  aka the pbo loading order
*the difference between config tree declarations vs their bodies
*the difference between config tree declarations vs their bodies
*what class blah{}; actually does (vs blah:blah{}) and how to implement it properly
*what class blah{}; actually does (vs blah:blah{}) and how to implement it properly
*how ofp behaves differently in class trees and what access= is all about
*how ofp behaves differently in class trees and what access= is all about
---------
---------


Class Inheritence refers to the way in which classes are superimposed onto each other.
Class Inheritance refers to the way in which classes are superimposed onto each other.




class Base
class Base
{
a base class containing (probably) embedded classes
class EmbeddedClass
  {
  {
   ...
   a base class containing (probably) embedded classes
  class EmbeddedClass
  {
  ...
  };
  class InheritedClass:EmbeddedClass
  {
  ...
  };
  };
  };
class InheritedClass:EmbeddedClass
{
  ...
};
};


The above is the creation of the class with real values
The above is the creation of the class with real values
Line 29: Line 30:
example
example


class Vehicles
class Vehicles
{
{
  class Vehicle{......};
  class Vehicle{......};
  class Car:Vehicle{......};
  class Car:Vehicle{......};
  class Truck:Car{......};
  class Truck:Car{......};
};
};


Inheritence skeleton
Inheritance skeleton


The engine needs to know how above is constructed when inheriting from it
The engine needs to know how above is constructed when inheriting from it




if you aren't altering embededded classes:
if you aren't altering embedded classes:


class Car;
class Car;


altering things in truck
altering things in truck


class Car;
class Car;
class Truck:Car{....};
class Truck:Car{....};


class anything{}; wipes out previous. NOTE however that reqiored addons is needed
class anything{}; wipes out previous. NOTE however that requiredAddons is needed

Revision as of 08:19, 23 July 2010

this is not ready for prime time.

i am just getting some ideas down on how to explain

  • the necessity of requiredAddons[]= aka the pbo loading order
  • the difference between config tree declarations vs their bodies
  • what class blah{}; actually does (vs blah:blah{}) and how to implement it properly
  • how ofp behaves differently in class trees and what access= is all about

Class Inheritance refers to the way in which classes are superimposed onto each other.


class Base
{
 a base class containing (probably) embedded classes
 class EmbeddedClass
 {
  ...
 };
 class InheritedClass:EmbeddedClass
 {
  ...
 };
};

The above is the creation of the class with real values

example

class Vehicles
{
  class Vehicle{......};
  class Car:Vehicle{......};
  class Truck:Car{......};
};

Inheritance skeleton

The engine needs to know how above is constructed when inheriting from it


if you aren't altering embedded classes:

class Car;

altering things in truck

class Car;
class Truck:Car{....};

class anything{}; wipes out previous. NOTE however that requiredAddons is needed