User Tools

Site Tools


arma:config:inheritance

Inheritance

Inheritance in ArmA configs.

If you create a custom addon, and you want to base your thing on something that already exists and does not need to be redefined, you can use the following example: (test2 will be equal to test1 in this example).

	class test1;
	class test2: test1 {};

You can inherit from other classes, e.g in this example, class test2 is equal to test1:

	class test1
	{
		val1 = 1;
		val2 = 2;
		val3 = 0;
	};
	class test2: test1{};

In this example, test2 inherits all variables and values of test1, but changes val2 and adds a val4:

	class test1
	{
		val1 = 1;
		val2 = 2;
		val3 = 0;
	};
	class test2: test1
	{
		val2 = 3;
		val4 = 1;
	};
arma/config/inheritance.txt · Last modified: 2009-04-17 11:34 (external edit)