Release 0.1.9-alpha: Merge branch 'dev'

coolant-mod
krzys-h 2016-11-02 21:42:22 +01:00
commit f96cf394a3
56 changed files with 3404 additions and 1235 deletions

View File

@ -1,72 +1,122 @@
\b;Instruction \c;class\n;
This allows you to declare a class definition using following syntax:
This keyword allows you to create a class definition by using the following syntax:
\c;
\s;public class ClassName
\s;{
\s; declarations;
\s;}
\n;
Classes can only be \l;public\u cbot\public;, that is they can be used from all bots in a mission. Class members are also public, that is they are accessible from outside the class. Class members can be fields or functions (also called methods), for example the followin class \c;MyClass\n; contains 4 fields (a, b, x and s) and one method (MyFunction).
\t;All Classes Are Public
Classes can be only \l;public\u cbot\public;. This means that they can be used by all bots in a mission.
\b;Class Members
Class members are fields (\l;variables\u cbot\var;) and methods (\l;functions\u cbot\function;).
For example, the following class dubbed \c;MyClass\n; contains 4 fields (\c;a\n;, \c;b\n;, \c;x\n; and \c;s\n;) and one method (\c;MyFunction\n;).
\c;
\s;public class MyClass
\s;{
\s; int a, b;
\s; float x = 3.33;
\s; string s = "hello";
\s; float MyFunction( float value )
\s; float MyFunction(float value)
\s; {
\s; return (value*x)-1;
\s; return (value * x) - 1;
\s; }
\s;}
\n;
As shown in this exemple the class members can be initialized (\c;x=3.33\n;). You can also define a constructor which is a special method having the same name as the class name. This method will be called automatically at creation time of a class instance. You can also declare more than one method with the same name but different parameters.
\b;Accessing Class Members
Class members can be accessed outside of the class definition by using the \c;.\n; operator. Example:
\c;
\s;public class MyClass
\s;{
\s; int myField = 0;
\s; int MyFunction()
\s; {
\s; return myField * 2;
\s; }
\s;}
\s;
\s;extern void object::Test()
\s;{
\s; MyClass myObject();
\s; myObject.myField = 10;
\s; message(myObject.MyFunction()); // 20
\s; MyClass mySecondObject();
\s; mySecondObject.myField = myObject.myField - 2;
\s; message(mySecondObject.MyFunction()); // 16
\s;}
\n;
Class members are \l;public\u cbot\public; by default, which means that they are accessible outside of the class definition. They can also be declared as \c;\l;private\u cbot\private;\n; or \c;\l;protected\u cbot\protected;\n;. Such members can only be accessed inside of the class definition.
\t;Class Members Modifiers
Fields and methods can also be declared as \c;\l;static\u cbot\static;\n;. Methods can be additionaly declared as \c;\l;synchronized\u cbot\synchro;\n;.
\t;Member Initialization
As shown in the previous example, the class members can be initialized in the class definition (\c;int x = 3.33;\n;).
Another way of initiliazing fields is by defining a constructor which is a special method having the same name as the class. This method will be called automatically at \l;creation\u cbot\new; time of a class instance. Constructors can be \l;overloaded\u cbot\function;.
Example:\c;
\s;public class MyClass
\s;{
\s; int a, b;
\s; void MyClass( )
\s; void MyClass()
\s; {
\s; a = 2; b = 3;
\s; }
\s; void MyClass( int a, int b )
\s; void MyClass(int a, int b)
\s; {
\s; this.a = a; this.b = b;
\s; }
\s;}
\n;
In this example two constructors are declared for \c;MyClass\n;, one without parameters and the other one with two parameters. As the names of the parameters of the second constructor are the same as the names of the two members \c;a\n; et \c;b\n; we must use the \c;\l;this\u cbot\this;.a\n; and \c;\l;this\u cbot\this;.b\n; to avoid confusion with the parameters. Another more simpler solution would be to give different names to the parameters.
\t;Using \c;\l;this\u cbot\this;\n;
As the names of the parameters of the second constructor are the same as the names of the two members \c;a\n; and \c;b\n;, we must use the \c;\l;this\u cbot\this;\n; \l;reference\u cbot\pointer; to avoid confusion with the parameters' names.
\b;Object Creation
You can create objects of type \c;YourClass\n; using the \c;\l;new\u cbot\new;\n; keyword. Example:
\c;
\s;void Test( )
\s;extern void object::Test()
\s;{
\s; MyClass item1(); // constr. w/o parameters
\s; MyClass item2(4, 5); // constr. with 2 parameters
\s; MyClass item3; // no constructor called,
\s; // therefore item3 == null
\s; MyClass object1(); // Call default constructor (without parameters)
\s; MyClass object2(4, 5); // Call constructor with two int parameters
\s; MyClass object3; // No constructor called, object3 == null
\s; object3 = new MyClass(); // We call constructor now, object3 != null
\s;}
\n;
You can also define a destructor. This must be a \c;void\n; fonction without parameters that has the same name as the class name but prefixed by the ~ character. The destructor is called automatically as soon as the class instance is no more referenced by anyone.
\b;Object Destruction
You can also define a destructor. This must be a \c;\l;void\u cbot\void;\n; fonction without parameters, which has the same name as the class but prefixed with the \c;~\n; character. The destructor is called automatically as soon as the class instance is no more referenced by anyone. Example:
\c;
\s;public class MyClass
\s;{
\s; static private int counter = 0; // instance counter
\s; void MyClass( )
\s; {
\s; counter ++; // one instance more
\s; counter++; // one instance more
\s; }
\s; void ~MyClass( )
\s; {
\s; counter --; // one instance less
\s; counter--; // one instance less
\s; }
\s;}
\s;void Test()
\s;extern void object::Test()
\s;{
\s; MyClass item1( ); // counter = 1
\s; MyClass item2( ); // counter = 2
\s; item1 = null; // counter = 1
\s;} // counter = 0
\s; // counter == 0
\s; MyClass item1( ); // counter == 1
\s; MyClass item2( ); // counter == 2
\s; item1 = null; // counter == 1
\s;}
\s;// counter == 0
\n;
If you pass a class instance as parameter to a \l;function\u cbot\function;, the function only receives a \l;reference\u cbot\pointer; to the instance. That means if you modify the instance in the function, the instance that has been passed to the function will be actuallay modified.
\b;Passing Objects to Functions
Objects in CBOT are passed by \l;reference\u cbot\pointer;. This means that when an object is passed to a \l;function\u cbot\function;, the function receives a copy of a pointer to the instance, not a copy of the object, so any modifications on the object will be visible outside of the function.
\b;Inheritance
A class can inherit public and protected members of another class by using the \c;\l;extends\u cbot\extends;\n; keyword.
\t;See also
\c;\l;public\u cbot\public;\n;, \c;\l;private\u cbot\private;\n;, \c;\l;static\u cbot\static;\n;, \c;\l;synchronized\u cbot\synchro;\n;, \c;\l;new\u cbot\new;\n;, \c;\l;reference\u cbot\pointer;\n;, \c;\l;this\u cbot\this;\n;
\c;\l;public\u cbot\public;\n;, \c;\l;private\u cbot\private;\n;, \c;\l;protected\u cbot\protected;\n;, \c;\l;static\u cbot\static;\n;, \c;\l;synchronized\u cbot\synchro;\n;, \c;\l;new\u cbot\new;\n;, \c;\l;reference\u cbot\pointer;\n;, \c;\l;this\u cbot\this;\n;, \c;\l;super\u cbot\super;\n;, \c;\l;extends\u cbot\extends;\n;
\l;Programming\u cbot;, \l;types\u cbot\type; and \l;categories\u cbot\category;.

107
help/cbot/E/extends.txt Normal file
View File

@ -0,0 +1,107 @@
\b;Keyword \c;extends\n;
This keyword is used in a \c;\l;class\u cbot\class;\n; definition when we want the class to inherit members from another class. The class which is extended we usually call a parent or base, the extending class we call a child.
\t;Example
\c;
\s;public class Parent
\s;{
\s; void foo()
\s; {
\s; message("foo");
\s; }
\s;}
\s;
\s;public class Child extends Parent
\s;{
\s; void bar()
\s; {
\s; message("bar");
\s; }
\s;}
\s;
\s;extern void object::Test()
\s;{
\s; Child child();
\s; child.foo(); // Will show "foo"
\s; child.bar(); // Will show "bar"
\s;}
\n;
\b;Inherited Members
Only \c;\l;public\u cbot\public;\n; and \c;\l;protected\u cbot\protected;\n; members are inherited. \c;\l;private\u cbot\private;\n; members are directly inaccessible even for a child, although they can be accessed indirectly through inherited methods.
Constructors and destructors are not inherited, however, they can be overriden.
\b;Method Overriding
Inherited methods can be overriden (redefined) in the child class definition. Example:
\c;
\s;public class Parent
\s;{
\s; void foo()
\s; {
\s; message("foo");
\s; }
\s;}
\s;
\s;public class Child extends Parent
\s;{
\s; void foo()
\s; {
\s; message("bar");
\s; }
\s;}
\s;
\s;extern void object::Test()
\s;{
\s; Child child();
\s; child.foo(); // Will show "bar"
\s;}
\n;
A parent's method can be called inside an overriden method by using the \c;\l;super\u cbot\super;\n; keyword.
\b;Polymorphism
\c;\l;Reference\u cbot\pointer;\n; of type Parent can point to an object of type Child. However, such a pointer can't be used to access a child member. In order to access a child member, it must be assured that the Parent reference really points to a Child object. If that's the case, it can be safely copied to a pointer of type Child, which has access to the child members.
\t;Example
\c;
\s;public class Parent
\s;{
\s; void foo()
\s; {
\s; message("foo");
\s; }
\s;}
\s;
\s;public class Child extends Parent
\s;{
\s; void foo()
\s; {
\s; message("bar");
\s; }
\s; void bar()
\s; {
\s; message("foo bar");
\s; }
\s;}
\s;
\s;extern void object::Test()
\s;{
\s; Parent people[2];
\s; people[0] = new Parent();
\s; people[1] = new Child();
\s; for (int i = 0; i < 2; ++i)
\s; {
\s; people[i].foo();
\s; }
\s; //people[1].bar(); // Error
\s; Child child = people[1];
\s; child.bar(); // OK
\s;}
\n;
\b;Multiple Inheritance
A child cannot have multiple parents, however, a parent can have many children.
\t;See also
\c;\l;class\u cbot\class;\n;, \c;\l;public\u cbot\public;\n;, \c;\l;private\u cbot\private;\n;, \c;\l;protected\u cbot\protected;\n;, \c;\l;new\u cbot\new;\n;, \c;\l;reference\u cbot\pointer;\n;, \c;\l;this\u cbot\this;\n;, \c;\l;super\u cbot\super;\n;
\l;Programming\u cbot;, \l;types\u cbot\type; and \l;categories\u cbot\category;.

View File

@ -12,6 +12,7 @@ To open a file, proceed as follows:
\n;
\c;"r"\n; mode: open for reading.
\c;"w"\n; mode: open for writing.
\c;"a"\n; mode: open for appending.
Files can only be created and opened in the files/ folder which is located in the folder where Colobot has been installed. You cannot not create or open files that are located elsewhere than in the files/ folder.

View File

@ -1,10 +1,11 @@
\b;Instruction \c;openfile\n;
\c;openfile();\n; opens an text file in the files/ folder. This is not a method of the \c;\l;file\u cbot\file;\n; class but openfile returne a \l;reference\u cbot\pointer; to a new instance of the file class. You must supply two parameters, the filename and the opening mode.
\c;openfile();\n; opens an text file in the files/ folder. This is not a method of the \c;\l;file\u cbot\file;\n; class but openfile returns a \l;reference\u cbot\pointer; to a new instance of the file class. You must supply two parameters, the filename and the opening mode.
\c;
\s;file handle = openfile("filename", "r");
\n;
\c;"r"\n; mode: open for reading.
\c;"w"\n; mode: open for writing.
\c;"w"\n; mode: open for appending.
\t;See also

View File

@ -1,5 +1,7 @@
\b;Instruction \c;private\n; (for specialists)
\l;Class\u cbot\class; members can be \l;public\u cbot\public; (by default) or private. A member can be declared private by putting \c;private\n; before the type declaration of the member. Private members are not accessible from outside the class definition.
This is an access modifier for \l;class\u cbot\class; members. Private members are not accessible outside of the class definition.
\t;Example
\c;
\s;public class MyClass
\s;{
@ -15,5 +17,5 @@
\s;}
\n;
\t;See also
\c;\l;class\u cbot\class;\n;, \c;\l;public\u cbot\public;\n;
\c;\l;class\u cbot\class;\n;, \c;\l;public\u cbot\public;\n;, \c;\l;protected\u cbot\protected;\n;
\l;Programming\u cbot;, \l;types\u cbot\type; and \l;categories\u cbot\category;.

28
help/cbot/E/protected.txt Normal file
View File

@ -0,0 +1,28 @@
\b;Keyword \c;protected\n;
This is an access modifier for \l;class\u cbot\class; members. Protected class members can be accessed in a child class, but they can't be accessed outside of classes definitions being part of the same inheritance tree (see the \c;\l;extends\u cbot\extends;\n; keyword).
\t;Example
\c;
\s;public class Parent
\s;{
\s; protected int field = 0;
\s;}
\s;
\s;public class Child extends Parent
\s;{
\s; void Print()
\s; {
\s; message(field);
\s; }
\s;}
\s;
\s;extern void object::Test()
\s;{
\s; Child child();
\s; child.Print(); // 0
\s; //child.field = 1; // Error!
\s;}
\n;
\t;See also
\c;\l;class\u cbot\class;\n;, \c;\l;public\u cbot\public;\n;, \c;\l;private\u cbot\private;\n;, \c;\l;extends\u cbot\extends;\n;
\l;Programming\u cbot;, \l;types\u cbot\type; and \l;categories\u cbot\category;.

View File

@ -31,7 +31,7 @@ If you have declared a function \c;public\n;, you cannot define a function with
If a bot containing a \c;public\n; function is destroyed, the other bots that make use of this function will be stopped with an error.
\b;Instruction \c;public\n; for classes
\l;Class\u cbot\class; members can be public (by default) or \l;privat\u cbot\private;. A member can be declared private by putting \c;private\n; before the member type. Private members are not accessible from outside the class definition.
\c;public\n; is also an access modifier for \l;class\u cbot\class; members, which is the default one. Public members can be accessed from outside of the class definition.
\c;
\s;public class MyClass
\s;{
@ -47,5 +47,5 @@ If a bot containing a \c;public\n; function is destroyed, the other bots that ma
\s;}
\n;
\t;See also
\c;\l;class\u cbot\class;\n;, \c;\l;private\u cbot\private;\n;, \c;\l;functions\u cbot\function;\n;
\c;\l;class\u cbot\class;\n;, \c;\l;private\u cbot\private;\n;, \c;\l;protected\u cbot\protected;\n;, \c;\l;functions\u cbot\function;\n;
\l;Programming\u cbot;, \l;types\u cbot\type; and \l;categories\u cbot\category;.

47
help/cbot/E/super.txt Normal file
View File

@ -0,0 +1,47 @@
\b;Keyword \c;super\n;
This keyword is similar to \c;\l;this\u cbot\this;\n;, however, it grants access to methods from the parent class (see the \c;\l;extends\u cbot\extends;\n; keyword), which is especially useful for method overriding.
\t;Example
\c;
\s;public class Parent
\s;{
\s; protected int field;
\s;
\s; void Parent()
\s; {
\s; field = 0;
\s; }
\s;
\s; void Print()
\s; {
\s; message("Parent's field: " + field);
\s; }
\s;}
\s;
\s;public class Child extends Parent
\s;{
\s; private int childsField;
\s;
\s; void Child()
\s; {
\s; super.Parent();
\s; childsField = field + 1;
\s; }
\s;
\s; void Print()
\s; {
\s; super.Print();
\s; message("Child's field: " + childsField);
\s; }
\s;}
\s;
\s;extern void object::Test()
\s;{
\s; Child child();
\s; child.Print(); // Will show both 0 and 1
\s;}
\n;
\t;See also
\c;\l;class\u cbot\class;\n;, \c;\l;this\u cbot\this;\n;
\l;Programming\u cbot;, \l;types\u cbot\type; and \l;categories\u cbot\category;.

View File

@ -50,5 +50,5 @@ However if a field name is hidden by a parameter declaration or a variable decla
\s;}
\n;
\t;See also
\c;\l;class\u cbot\class;\n;
\c;\l;class\u cbot\class;\n;, \c;\l;super\u cbot\super;\n;
\l;Programming\u cbot;, \l;types\u cbot\type; and \l;categories\u cbot\category;.

View File

@ -53,13 +53,13 @@ msgid "Time in seconds."
msgstr ""
#. type: \t; header
#: ../E/abstime.txt:10 ../E/acos.txt:11 ../E/aim.txt:23 ../E/array.txt:41 ../E/asin.txt:11 ../E/atan.txt:11 ../E/atan2.txt:16 ../E/bloc.txt:48 ../E/bool.txt:4 ../E/break.txt:24 ../E/build.txt:27 ../E/buildingenabled.txt:22 ../E/busy.txt:14 ../E/canbuild.txt:22 ../E/canresearch.txt:14 ../E/category.txt:109 ../E/ceil.txt:12 ../E/class.txt:70 ../E/close.txt:6 ../E/cond.txt:4 ../E/continue.txt:24 ../E/cos.txt:11 ../E/deletef.txt:9 ../E/delinfo.txt:13 ../E/destroy.txt:15 ../E/detect.txt:27 ../E/direct.txt:13 ../E/dist.txt:29 ../E/dist2d.txt:13 ../E/do.txt:27 ../E/drop.txt:28 ../E/eof.txt:13 ../E/errmode.txt:32 ../E/expr.txt:197 ../E/extern.txt:29 ../E/factory.txt:21 ../E/false.txt:4 ../E/file.txt:16 ../E/fire.txt:30 ../E/flatgrnd.txt:16 ../E/flatspace.txt:25 ../E/float.txt:24 ../E/floor.txt:12 ../E/for.txt:51 ../E/function.txt:129 ../E/goto.txt:34 ../E/grab.txt:28 ../E/if.txt:39 ../E/int.txt:18 ../E/jet.txt:14 ../E/message.txt:24 ../E/motor.txt:38 ../E/move.txt:21 ../E/nan.txt:14 ../E/new.txt:20 ../E/null.txt:4 ../E/object.txt:79 ../E/open.txt:18 ../E/openfile.txt:10 ../E/pencolor.txt:14 ../E/pendown.txt:17 ../E/penup.txt:11 ../E/penwidth.txt:14 ../E/point.txt:35 ../E/pointer.txt:51 ../E/pow.txt:14 ../E/private.txt:17 ../E/produce.txt:30 ../E/public.txt:49 ../E/radar.txt:80 ../E/radarall.txt:19 ../E/rand.txt:8 ../E/readln.txt:18 ../E/receive.txt:16 ../E/recycle.txt:12 ../E/research.txt:18 ../E/researched.txt:14 ../E/researches.txt:27 ../E/retobj.txt:13 ../E/return.txt:29 ../E/round.txt:12 ../E/search.txt:25 ../E/send.txt:17 ../E/shield.txt:18 ../E/sin.txt:11 ../E/sizeof.txt:21 ../E/sniff.txt:16 ../E/space.txt:22 ../E/sqrt.txt:11 ../E/static.txt:20 ../E/strfind.txt:18 ../E/string.txt:32 ../E/strleft.txt:14 ../E/strlen.txt:12 ../E/strlower.txt:10 ../E/strmid.txt:18 ../E/strright.txt:14 ../E/strupper.txt:10 ../E/strval.txt:17 ../E/switch.txt:70 ../E/synchro.txt:23 ../E/takeoff.txt:15 ../E/tan.txt:11 ../E/term.txt:30 ../E/testinfo.txt:16 ../E/this.txt:52 ../E/thump.txt:12 ../E/topo.txt:13 ../E/true.txt:4 ../E/trunc.txt:12 ../E/turn.txt:32 ../E/type.txt:32 ../E/var.txt:66 ../E/void.txt:10 ../E/wait.txt:21 ../E/while.txt:46 ../E/writeln.txt:19
#: ../E/abstime.txt:10 ../E/acos.txt:11 ../E/aim.txt:23 ../E/array.txt:41 ../E/asin.txt:11 ../E/atan.txt:11 ../E/atan2.txt:16 ../E/bloc.txt:48 ../E/bool.txt:4 ../E/break.txt:24 ../E/build.txt:27 ../E/buildingenabled.txt:22 ../E/busy.txt:14 ../E/canbuild.txt:22 ../E/canresearch.txt:14 ../E/category.txt:109 ../E/ceil.txt:12 ../E/class.txt:120 ../E/close.txt:6 ../E/cond.txt:4 ../E/continue.txt:24 ../E/cos.txt:11 ../E/deletef.txt:9 ../E/delinfo.txt:13 ../E/destroy.txt:15 ../E/detect.txt:27 ../E/direct.txt:13 ../E/dist.txt:29 ../E/dist2d.txt:13 ../E/do.txt:27 ../E/drop.txt:28 ../E/eof.txt:13 ../E/errmode.txt:32 ../E/expr.txt:197 ../E/extends.txt:105 ../E/extern.txt:29 ../E/factory.txt:21 ../E/false.txt:4 ../E/file.txt:16 ../E/fire.txt:30 ../E/flatgrnd.txt:16 ../E/flatspace.txt:25 ../E/float.txt:24 ../E/floor.txt:12 ../E/for.txt:51 ../E/function.txt:129 ../E/goto.txt:34 ../E/grab.txt:28 ../E/if.txt:39 ../E/int.txt:18 ../E/jet.txt:14 ../E/message.txt:24 ../E/motor.txt:38 ../E/move.txt:21 ../E/nan.txt:14 ../E/new.txt:20 ../E/null.txt:4 ../E/object.txt:79 ../E/open.txt:19 ../E/openfile.txt:11 ../E/pencolor.txt:14 ../E/pendown.txt:17 ../E/penup.txt:11 ../E/penwidth.txt:14 ../E/point.txt:35 ../E/pointer.txt:51 ../E/pow.txt:14 ../E/private.txt:19 ../E/produce.txt:30 ../E/protected.txt:26 ../E/public.txt:49 ../E/radar.txt:80 ../E/radarall.txt:19 ../E/rand.txt:8 ../E/readln.txt:18 ../E/receive.txt:16 ../E/recycle.txt:12 ../E/research.txt:18 ../E/researched.txt:14 ../E/researches.txt:27 ../E/retobj.txt:13 ../E/return.txt:29 ../E/round.txt:12 ../E/search.txt:25 ../E/send.txt:17 ../E/shield.txt:18 ../E/sin.txt:11 ../E/sizeof.txt:21 ../E/sniff.txt:16 ../E/space.txt:22 ../E/sqrt.txt:11 ../E/static.txt:20 ../E/strfind.txt:18 ../E/string.txt:32 ../E/strleft.txt:14 ../E/strlen.txt:12 ../E/strlower.txt:10 ../E/strmid.txt:18 ../E/strright.txt:14 ../E/strupper.txt:10 ../E/strval.txt:17 ../E/super.txt:45 ../E/switch.txt:70 ../E/synchro.txt:23 ../E/takeoff.txt:15 ../E/tan.txt:11 ../E/term.txt:30 ../E/testinfo.txt:16 ../E/this.txt:52 ../E/thump.txt:12 ../E/topo.txt:13 ../E/true.txt:4 ../E/trunc.txt:12 ../E/turn.txt:32 ../E/type.txt:32 ../E/var.txt:66 ../E/void.txt:10 ../E/wait.txt:21 ../E/while.txt:46 ../E/writeln.txt:19
#, no-wrap
msgid "See also"
msgstr ""
#. type: Plain text
#: ../E/abstime.txt:11 ../E/aim.txt:24 ../E/array.txt:42 ../E/bool.txt:5 ../E/break.txt:25 ../E/busy.txt:15 ../E/cond.txt:5 ../E/continue.txt:25 ../E/deletef.txt:10 ../E/destroy.txt:16 ../E/detect.txt:28 ../E/direct.txt:14 ../E/dist.txt:30 ../E/dist2d.txt:14 ../E/drop.txt:29 ../E/errmode.txt:33 ../E/expr.txt:198 ../E/extern.txt:30 ../E/false.txt:5 ../E/fire.txt:31 ../E/flatgrnd.txt:17 ../E/flatspace.txt:26 ../E/float.txt:25 ../E/for.txt:52 ../E/function.txt:130 ../E/goto.txt:35 ../E/grab.txt:29 ../E/if.txt:40 ../E/int.txt:19 ../E/jet.txt:15 ../E/message.txt:25 ../E/move.txt:22 ../E/nan.txt:15 ../E/object.txt:80 ../E/openfile.txt:11 ../E/pencolor.txt:15 ../E/pendown.txt:18 ../E/penup.txt:12 ../E/penwidth.txt:15 ../E/point.txt:36 ../E/produce.txt:31 ../E/recycle.txt:13 ../E/retobj.txt:14 ../E/return.txt:30 ../E/search.txt:26 ../E/shield.txt:19 ../E/sizeof.txt:22 ../E/sniff.txt:17 ../E/space.txt:23 ../E/string.txt:33 ../E/switch.txt:71 ../E/takeoff.txt:16 ../E/term.txt:31 ../E/thump.txt:13 ../E/topo.txt:14 ../E/true.txt:5 ../E/turn.txt:33 ../E/type.txt:33 ../E/var.txt:67 ../E/void.txt:11 ../E/wait.txt:22
#: ../E/abstime.txt:11 ../E/aim.txt:24 ../E/array.txt:42 ../E/bool.txt:5 ../E/break.txt:25 ../E/busy.txt:15 ../E/cond.txt:5 ../E/continue.txt:25 ../E/deletef.txt:10 ../E/destroy.txt:16 ../E/detect.txt:28 ../E/direct.txt:14 ../E/dist.txt:30 ../E/dist2d.txt:14 ../E/drop.txt:29 ../E/errmode.txt:33 ../E/expr.txt:198 ../E/extern.txt:30 ../E/false.txt:5 ../E/fire.txt:31 ../E/flatgrnd.txt:17 ../E/flatspace.txt:26 ../E/float.txt:25 ../E/for.txt:52 ../E/function.txt:130 ../E/goto.txt:35 ../E/grab.txt:29 ../E/if.txt:40 ../E/int.txt:19 ../E/jet.txt:15 ../E/message.txt:25 ../E/move.txt:22 ../E/nan.txt:15 ../E/object.txt:80 ../E/openfile.txt:12 ../E/pencolor.txt:15 ../E/pendown.txt:18 ../E/penup.txt:12 ../E/penwidth.txt:15 ../E/point.txt:36 ../E/produce.txt:31 ../E/recycle.txt:13 ../E/retobj.txt:14 ../E/return.txt:30 ../E/search.txt:26 ../E/shield.txt:19 ../E/sizeof.txt:22 ../E/sniff.txt:17 ../E/space.txt:23 ../E/string.txt:33 ../E/switch.txt:71 ../E/takeoff.txt:16 ../E/term.txt:31 ../E/thump.txt:13 ../E/topo.txt:14 ../E/true.txt:5 ../E/turn.txt:33 ../E/type.txt:33 ../E/var.txt:67 ../E/void.txt:11 ../E/wait.txt:22
#, no-wrap
msgid "<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
@ -478,12 +478,6 @@ msgstr ""
msgid "Instruction <code>class</code>"
msgstr ""
#. type: Plain text
#: ../E/class.txt:2
#, no-wrap
msgid "This allows you to declare a class definition using following syntax:"
msgstr ""
#. type: Source code
#: ../E/class.txt:4
#, no-wrap
@ -494,115 +488,6 @@ msgid ""
"}"
msgstr ""
#. type: Plain text
#: ../E/class.txt:9
#, no-wrap
msgid "Classes can only be <a cbot|public>public</a>, that is they can be used from all bots in a mission. Class members are also public, that is they are accessible from outside the class. Class members can be fields or functions (also called methods), for example the followin class <code>MyClass</code> contains 4 fields (a, b, x and s) and one method (MyFunction)."
msgstr ""
#. type: Source code
#: ../E/class.txt:11
#, no-wrap
msgid ""
"public class MyClass\n"
"{\n"
"\tint a, b;\n"
"\tfloat x = 3.33;\n"
"\tstring s = \"hello\";\n"
"\tfloat MyFunction( float value )\n"
"\t{\n"
"\t\treturn (value*x)-1;\n"
"\t}\n"
"}"
msgstr ""
#. type: Plain text
#: ../E/class.txt:22
#, no-wrap
msgid "As shown in this exemple the class members can be initialized (<code>x=3.33</code>). You can also define a constructor which is a special method having the same name as the class name. This method will be called automatically at creation time of a class instance. You can also declare more than one method with the same name but different parameters."
msgstr ""
#. type: Source code
#: ../E/class.txt:24
#, no-wrap
msgid ""
"public class MyClass\n"
"{\n"
"\tint a, b;\n"
"\tvoid MyClass( )\n"
"\t{\n"
"\t\ta = 2; b = 3;\n"
"\t}\n"
"\tvoid MyClass( int a, int b )\n"
"\t{\n"
"\t\tthis.a = a; this.b = b;\n"
"\t}\n"
"}"
msgstr ""
#. type: Plain text
#: ../E/class.txt:37
#, no-wrap
msgid "In this example two constructors are declared for <code>MyClass</code>, one without parameters and the other one with two parameters. As the names of the parameters of the second constructor are the same as the names of the two members <code>a</code> et <code>b</code> we must use the <code><a cbot|this>this</a>.a</code> and <code><a cbot|this>this</a>.b</code> to avoid confusion with the parameters. Another more simpler solution would be to give different names to the parameters."
msgstr ""
#. type: Source code
#: ../E/class.txt:39
#, no-wrap
msgid ""
"void Test( )\n"
"{\n"
"\tMyClass item1(); // constr. w/o parameters\n"
"\tMyClass item2(4, 5); // constr. with 2 parameters\n"
"\tMyClass item3; // no constructor called,\n"
" // therefore item3 == null\n"
"}"
msgstr ""
#. type: Plain text
#: ../E/class.txt:47
#, no-wrap
msgid "You can also define a destructor. This must be a <code>void</code> fonction without parameters that has the same name as the class name but prefixed by the ~ character. The destructor is called automatically as soon as the class instance is no more referenced by anyone."
msgstr ""
#. type: Source code
#: ../E/class.txt:49
#, no-wrap
msgid ""
"public class MyClass\n"
"{\n"
"\tstatic private int counter = 0; // instance counter\n"
"\tvoid MyClass( )\n"
"\t{\n"
"\t\tcounter ++; // one instance more\n"
"\t}\n"
"\tvoid ~MyClass( )\n"
"\t{\n"
"\t\tcounter --; // one instance less\n"
"\t}\n"
"}\n"
"void Test()\n"
"{\n"
"\tMyClass item1( ); // counter = 1\n"
"\tMyClass item2( ); // counter = 2\n"
"\titem1 = null; // counter = 1\n"
"} // counter = 0"
msgstr ""
#. type: Plain text
#: ../E/class.txt:68
#, no-wrap
msgid "If you pass a class instance as parameter to a <a cbot|function>function</a>, the function only receives a <a cbot|pointer>reference</a> to the instance. That means if you modify the instance in the function, the instance that has been passed to the function will be actuallay modified."
msgstr ""
#. type: Plain text
#: ../E/class.txt:71
#, no-wrap
msgid ""
"<code><a cbot|public>public</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|static>static</a></code>, <code><a cbot|synchro>synchronized</a></code>, <code><a cbot|new>new</a></code>, <code><a cbot|pointer>reference</a></code>, <code><a cbot|this>this</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: \b; header
#: ../E/close.txt:1
#, no-wrap
@ -2419,21 +2304,13 @@ msgid ""
msgstr ""
#. type: Plain text
#: ../E/open.txt:13 ../E/openfile.txt:6
#, no-wrap
msgid ""
"<code>\"r\"</code> mode: open for reading.\n"
"<code>\"w\"</code> mode: open for writing."
msgstr ""
#. type: Plain text
#: ../E/open.txt:16
#: ../E/open.txt:17
#, no-wrap
msgid "Files can only be created and opened in the files/ folder which is located in the folder where Colobot has been installed. You cannot not create or open files that are located elsewhere than in the files/ folder."
msgstr ""
#. type: Plain text
#: ../E/open.txt:19
#: ../E/open.txt:20
#, no-wrap
msgid ""
"<code><a cbot|file>file</a></code>, <code><a cbot|close>close</a></code>, <code><a cbot|readln>readln</a></code>, <code><a cbot|writeln>writeln</a></code> and <code><a cbot|eof>eof</a></code>.\n"
@ -2446,12 +2323,6 @@ msgstr ""
msgid "Instruction <code>openfile</code>"
msgstr ""
#. type: Plain text
#: ../E/openfile.txt:2
#, no-wrap
msgid "<c/>openfile();<n/> opens an text file in the files/ folder. This is not a method of the <code><a cbot|file>file</a></code> class but openfile returne a <a cbot|pointer>reference</a> to a new instance of the file class. You must supply two parameters, the filename and the opening mode."
msgstr ""
#. type: Source code
#: ../E/openfile.txt:4
#, no-wrap
@ -2681,14 +2552,8 @@ msgstr ""
msgid "Instruction <code>private</code> (for specialists)"
msgstr ""
#. type: Plain text
#: ../E/private.txt:2
#, no-wrap
msgid "<a cbot|class>Class</a> members can be <a cbot|public>public</a> (by default) or private. A member can be declared private by putting <code>private</code> before the type declaration of the member. Private members are not accessible from outside the class definition."
msgstr ""
#. type: Source code
#: ../E/private.txt:4
#: ../E/private.txt:6
#, no-wrap
msgid ""
"public class MyClass\n"
@ -2705,14 +2570,6 @@ msgid ""
"}"
msgstr ""
#. type: Plain text
#: ../E/private.txt:18
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|public>public</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: \b; header
#: ../E/public.txt:1
#, no-wrap
@ -2804,12 +2661,6 @@ msgstr ""
msgid "Instruction <code>public</code> for classes"
msgstr ""
#. type: Plain text
#: ../E/public.txt:34
#, no-wrap
msgid "<a cbot|class>Class</a> members can be public (by default) or <a cbot|private>privat</a>. A member can be declared private by putting <code>private</code> before the member type. Private members are not accessible from outside the class definition."
msgstr ""
#. type: Source code
#: ../E/public.txt:36
#, no-wrap
@ -2828,14 +2679,6 @@ msgid ""
"}"
msgstr ""
#. type: Plain text
#: ../E/public.txt:50
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|function>functions</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: \b; header
#: ../E/radar.txt:1
#, no-wrap
@ -4221,14 +4064,6 @@ msgid ""
"}"
msgstr ""
#. type: Plain text
#: ../E/this.txt:53
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: \b; header
#: ../E/thump.txt:1
#, no-wrap
@ -7282,7 +7117,7 @@ msgid "Firstly, the condition is valued and then the first result is returned if
msgstr ""
#. type: \t; header
#: ../E/expr.txt:157
#: ../E/expr.txt:157 ../E/extends.txt:4 ../E/extends.txt:65 ../E/private.txt:4 ../E/protected.txt:4 ../E/super.txt:4
#, no-wrap
msgid "Example"
msgstr ""
@ -7548,3 +7383,600 @@ msgid ""
" <code><a object|target1>Target1</a> </code>Flying target\n"
" <code><a object|nest>AlienNest</a> </code>Alien Nest"
msgstr ""
#. type: Plain text
#: ../E/class.txt:10
#, no-wrap
msgid "Classes can be only <a cbot|public>public</a>. This means that they can be used by all bots in a mission."
msgstr ""
#. type: \b; header
#: ../E/class.txt:12
#, no-wrap
msgid "Class Members"
msgstr ""
#. type: Plain text
#: ../E/class.txt:13
#, no-wrap
msgid "Class members are fields (<a cbot|var>variables</a>) and methods (<a cbot|function>functions</a>)."
msgstr ""
#. type: Plain text
#: ../E/class.txt:15
#, no-wrap
msgid "For example, the following class dubbed <code>MyClass</code> contains 4 fields (<code>a</code>, <code>b</code>, <code>x</code> and <code>s</code>) and one method (<code>MyFunction</code>)."
msgstr ""
#. type: Source code
#: ../E/class.txt:17
#, no-wrap
msgid ""
"public class MyClass\n"
"{\n"
"\tint a, b;\n"
"\tfloat x = 3.33;\n"
"\tstring s = \"hello\";\n"
"\tfloat MyFunction(float value)\n"
"\t{\n"
"\t\treturn (value * x) - 1;\n"
"\t}\n"
"}"
msgstr ""
#. type: \t; header
#: ../E/class.txt:55
#, no-wrap
msgid "Member Initialization"
msgstr ""
#. type: Plain text
#: ../E/class.txt:60
#, no-wrap
msgid "Example:<c/>"
msgstr ""
#. type: Source code
#: ../E/class.txt:61
#, no-wrap
msgid ""
"public class MyClass\n"
"{\n"
"\tint a, b;\n"
"\tvoid MyClass()\n"
"\t{\n"
"\t\ta = 2; b = 3;\n"
"\t}\n"
"\tvoid MyClass(int a, int b)\n"
"\t{\n"
"\t\tthis.a = a; this.b = b;\n"
"\t}\n"
"}"
msgstr ""
#. type: Plain text
#: ../E/class.txt:76
#, no-wrap
msgid "As the names of the parameters of the second constructor are the same as the names of the two members <code>a</code> and <code>b</code>, we must use the <code><a cbot|this>this</a></code> <a cbot|pointer>reference</a> to avoid confusion with the parameters' names."
msgstr ""
#. type: \b; header
#: ../E/class.txt:78
#, no-wrap
msgid "Object Creation"
msgstr ""
#. type: Plain text
#: ../E/class.txt:79
#, no-wrap
msgid "You can create objects of type <code>YourClass</code> using the <code><a cbot|new>new</a></code> keyword. Example:"
msgstr ""
#. type: \b; header
#: ../E/class.txt:90
#, no-wrap
msgid "Object Destruction"
msgstr ""
#. type: \b; header
#: ../E/class.txt:114
#, no-wrap
msgid "Passing Objects to Functions"
msgstr ""
#. type: Plain text
#: ../E/class.txt:115
#, no-wrap
msgid "Objects in CBOT are passed by <a cbot|pointer>reference</a>. This means that when an object is passed to a <a cbot|function>function</a>, the function receives a copy of a pointer to the instance, not a copy of the object, so any modifications on the object will be visible outside of the function."
msgstr ""
#. type: \b; header
#: ../E/class.txt:117
#, no-wrap
msgid "Inheritance"
msgstr ""
#. type: Plain text
#: ../E/class.txt:118
#, no-wrap
msgid "A class can inherit public and protected members of another class by using the <code><a cbot|extends>extends</a></code> keyword."
msgstr ""
#. type: Plain text
#: ../E/class.txt:2
#, no-wrap
msgid "This keyword allows you to create a class definition by using the following syntax:"
msgstr ""
#. type: \t; header
#: ../E/class.txt:9
#, no-wrap
msgid "All Classes Are Public"
msgstr ""
#. type: \t; header
#: ../E/class.txt:52
#, no-wrap
msgid "Class Members Modifiers"
msgstr ""
#. type: \t; header
#: ../E/class.txt:75
#, no-wrap
msgid "Using <code><a cbot|this>this</a></code>"
msgstr ""
#. type: Source code
#: ../E/class.txt:81
#, no-wrap
msgid ""
"extern void object::Test()\n"
"{\n"
"\tMyClass object1(); // Call default constructor (without parameters)\n"
"\tMyClass object2(4, 5); // Call constructor with two int parameters\n"
"\tMyClass object3; // No constructor called, object3 == null\n"
"\tobject3 = new MyClass(); // We call constructor now, object3 != null\n"
"}"
msgstr ""
#. type: Plain text
#: ../E/class.txt:91
#, no-wrap
msgid "You can also define a destructor. This must be a <code><a cbot|void>void</a></code> fonction without parameters, which has the same name as the class but prefixed with the <code>~</code> character. The destructor is called automatically as soon as the class instance is no more referenced by anyone. Example:"
msgstr ""
#. type: Source code
#: ../E/class.txt:93
#, no-wrap
msgid ""
"public class MyClass\n"
"{\n"
"\tstatic private int counter = 0; // instance counter\n"
"\tvoid MyClass( )\n"
"\t{\n"
"\t\tcounter++; // one instance more\n"
"\t}\n"
"\tvoid ~MyClass( )\n"
"\t{\n"
"\t\tcounter--; // one instance less\n"
"\t}\n"
"}\n"
"extern void object::Test()\n"
"{\n"
"\t // counter == 0\n"
"\tMyClass item1( ); // counter == 1\n"
"\tMyClass item2( ); // counter == 2\n"
"\titem1 = null; // counter == 1\n"
"}\n"
"// counter == 0"
msgstr ""
#. type: \b; header
#: ../E/class.txt:28
#, no-wrap
msgid "Accessing Class Members"
msgstr ""
#. type: Plain text
#: ../E/class.txt:29
#, no-wrap
msgid "Class members can be accessed outside of the class definition by using the <code>.</code> operator. Example:"
msgstr ""
#. type: Plain text
#: ../E/class.txt:50
#, no-wrap
msgid "Class members are <a cbot|public>public</a> by default, which means that they are accessible outside of the class definition. They can also be declared as <code><a cbot|private>private</a></code> or <code><a cbot|protected>protected</a></code>. Such members can only be accessed inside of the class definition."
msgstr ""
#. type: Plain text
#: ../E/class.txt:53
#, no-wrap
msgid "Fields and methods can also be declared as <code><a cbot|static>static</a></code>. Methods can be additionaly declared as <code><a cbot|synchro>synchronized</a></code>."
msgstr ""
#. type: Plain text
#: ../E/class.txt:58
#, no-wrap
msgid "Another way of initiliazing fields is by defining a constructor which is a special method having the same name as the class. This method will be called automatically at <a cbot|new>creation</a> time of a class instance. Constructors can be <a cbot|function>overloaded</a>."
msgstr ""
#. type: Source code
#: ../E/class.txt:31
#, no-wrap
msgid ""
"public class MyClass\n"
"{\n"
"\tint myField = 0;\n"
"\tint MyFunction()\n"
"\t{\n"
"\t\treturn myField * 2;\n"
"\t}\n"
"}\n"
"\n"
"extern void object::Test()\n"
"{\n"
"\tMyClass myObject();\n"
"\tmyObject.myField = 10;\n"
"\tmessage(myObject.MyFunction()); // 20\n"
"\tMyClass mySecondObject();\n"
"\tmySecondObject.myField = myObject.myField - 2;\n"
"\tmessage(mySecondObject.MyFunction()); // 16\n"
"}"
msgstr ""
#. type: Plain text
#: ../E/class.txt:121
#, no-wrap
msgid ""
"<code><a cbot|public>public</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|protected>protected</a></code>, <code><a cbot|static>static</a></code>, <code><a cbot|synchro>synchronized</a></code>, <code><a cbot|new>new</a></code>, <code><a cbot|pointer>reference</a></code>, <code><a cbot|this>this</a></code>, <code><a cbot|super>super</a></code>, <code><a cbot|extends>extends</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: \b; header
#: ../E/protected.txt:1
#, no-wrap
msgid "Keyword <code>protected</code>"
msgstr ""
#. type: Plain text
#: ../E/protected.txt:2
#, no-wrap
msgid "This is an access modifier for <a cbot|class>class</a> members. Protected class members can be accessed in a child class, but they can't be accessed outside of classes definitions being part of the same inheritance tree (see the <code><a cbot|extends>extends</a></code> keyword)."
msgstr ""
#. type: Source code
#: ../E/protected.txt:6
#, no-wrap
msgid ""
"public class Parent\n"
"{\n"
"\tprotected int field = 0;\n"
"}\n"
"\n"
"public class Child extends Parent\n"
"{\n"
"\tvoid Print()\n"
"\t{\n"
"\t\tmessage(field);\n"
"\t}\n"
"}\n"
"\n"
"extern void object::Test()\n"
"{\n"
"\tChild child();\n"
"\tchild.Print(); // 0\n"
"\t//child.field = 1; // Error!\n"
"}"
msgstr ""
#. type: Plain text
#: ../E/private.txt:2
#, no-wrap
msgid "This is an access modifier for <a cbot|class>class</a> members. Private members are not accessible outside of the class definition."
msgstr ""
#. type: Plain text
#: ../E/private.txt:20
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|public>public</a></code>, <code><a cbot|protected>protected</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: Plain text
#: ../E/public.txt:34
#, no-wrap
msgid "<code>public</code> is also an access modifier for <a cbot|class>class</a> members, which is the default one. Public members can be accessed from outside of the class definition."
msgstr ""
#. type: Plain text
#: ../E/public.txt:50
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|protected>protected</a></code>, <code><a cbot|function>functions</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: Plain text
#: ../E/protected.txt:27
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|public>public</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|extends>extends</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: \b; header
#: ../E/super.txt:1
#, no-wrap
msgid "Keyword <code>super</code>"
msgstr ""
#. type: Plain text
#: ../E/super.txt:46
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|this>this</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: Plain text
#: ../E/this.txt:53
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|super>super</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: \b; header
#: ../E/extends.txt:1
#, no-wrap
msgid "Keyword <code>extends</code>"
msgstr ""
#. type: \b; header
#: ../E/extends.txt:30
#, no-wrap
msgid "Inherited Members"
msgstr ""
#. type: Plain text
#: ../E/extends.txt:31
#, no-wrap
msgid "Only <code><a cbot|public>public</a></code> and <code><a cbot|protected>protected</a></code> members are inherited. <code><a cbot|private>private</a></code> members are directly inaccessible even for a child, although they can be accessed indirectly through inherited methods."
msgstr ""
#. type: Plain text
#: ../E/extends.txt:33
#, no-wrap
msgid "Constructors and destructors are not inherited, however, they can be overriden."
msgstr ""
#. type: \b; header
#: ../E/extends.txt:35
#, no-wrap
msgid "Method Overriding"
msgstr ""
#. type: Plain text
#: ../E/extends.txt:36
#, no-wrap
msgid "Inherited methods can be overriden (redefined) in the child class definition. Example:"
msgstr ""
#. type: Source code
#: ../E/extends.txt:38
#, no-wrap
msgid ""
"public class Parent\n"
"{\n"
"\tvoid foo()\n"
"\t{\n"
"\t\tmessage(\"foo\");\n"
"\t}\n"
"}\n"
"\n"
"public class Child extends Parent\n"
"{\n"
"\tvoid foo()\n"
"\t{\n"
"\t\tmessage(\"bar\");\n"
"\t}\n"
"}\n"
"\n"
"extern void object::Test()\n"
"{\n"
"\tChild child();\n"
"\tchild.foo(); // Will show \"bar\"\n"
"}"
msgstr ""
#. type: \b; header
#: ../E/extends.txt:62
#, no-wrap
msgid "Polymorphism"
msgstr ""
#. type: Plain text
#: ../E/extends.txt:63
#, no-wrap
msgid "<code><a cbot|pointer>Reference</a></code> of type Parent can point to an object of type Child. However, such a pointer can't be used to access a child member. In order to access a child member, it must be assured that the Parent reference really points to a Child object. If that's the case, it can be safely copied to a pointer of type Child, which has access to the child members."
msgstr ""
#. type: Source code
#: ../E/extends.txt:67
#, no-wrap
msgid ""
"public class Parent\n"
"{\n"
"\tvoid foo()\n"
"\t{\n"
"\t\tmessage(\"foo\");\n"
"\t}\n"
"}\n"
"\n"
"public class Child extends Parent\n"
"{\n"
"\tvoid foo()\n"
"\t{\n"
"\t\tmessage(\"bar\");\n"
"\t}\n"
"\tvoid bar()\n"
"\t{\n"
"\t\tmessage(\"foo bar\");\n"
"\t}\n"
"}\n"
"\n"
"extern void object::Test()\n"
"{\n"
"\tParent people[2];\n"
"\tpeople[0] = new Parent();\n"
"\tpeople[1] = new Child();\n"
"\tfor (int i = 0; i < 2; ++i)\n"
"\t{\n"
"\t\tpeople[i].foo();\n"
"\t}\n"
"\t//people[1].bar(); // Error\n"
"\tChild child = people[1];\n"
"\tchild.bar(); // OK\n"
"}"
msgstr ""
#. type: \b; header
#: ../E/extends.txt:102
#, no-wrap
msgid "Multiple Inheritance"
msgstr ""
#. type: Plain text
#: ../E/extends.txt:103
#, no-wrap
msgid "A child cannot have multiple parents, however, a parent can have many children."
msgstr ""
#. type: Plain text
#: ../E/extends.txt:106
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|public>public</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|protected>protected</a></code>, <code><a cbot|new>new</a></code>, <code><a cbot|pointer>reference</a></code>, <code><a cbot|this>this</a></code>, <code><a cbot|super>super</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: Plain text
#: ../E/super.txt:2
#, no-wrap
msgid "This keyword is similar to <code><a cbot|this>this</a></code>, however, it grants access to methods from the parent class (see the <code><a cbot|extends>extends</a></code> keyword), which is especially useful for method overriding."
msgstr ""
#. type: Source code
#: ../E/super.txt:6
#, no-wrap
msgid ""
"public class Parent\n"
"{\n"
"\tprotected int field;\n"
"\t\n"
"\tvoid Parent()\n"
"\t{\n"
"\t\tfield = 0;\n"
"\t}\n"
"\t\n"
"\tvoid Print()\n"
"\t{\n"
"\t\tmessage(\"Parent's field: \" + field);\n"
"\t}\n"
"}\n"
"\n"
"public class Child extends Parent\n"
"{\n"
"\tprivate int childsField;\n"
"\t\n"
"\tvoid Child()\n"
"\t{\n"
"\t\tsuper.Parent();\n"
"\t\tchildsField = field + 1;\n"
"\t}\n"
"\t\n"
"\tvoid Print()\n"
"\t{\n"
"\t\tsuper.Print();\n"
"\t\tmessage(\"Child's field: \" + childsField);\n"
"\t}\n"
"}\n"
"\n"
"extern void object::Test()\n"
"{\n"
"\tChild child();\n"
"\tchild.Print(); // Will show both 0 and 1\n"
"}"
msgstr ""
#. type: Plain text
#: ../E/extends.txt:2
#, no-wrap
msgid "This keyword is used in a <code><a cbot|class>class</a></code> definition when we want the class to inherit members from another class. The class which is extended we usually call a parent or base, the extending class we call a child."
msgstr ""
#. type: Source code
#: ../E/extends.txt:6
#, no-wrap
msgid ""
"public class Parent\n"
"{\n"
"\tvoid foo()\n"
"\t{\n"
"\t\tmessage(\"foo\");\n"
"\t}\n"
"}\n"
"\n"
"public class Child extends Parent\n"
"{\n"
"\tvoid bar()\n"
"\t{\n"
"\t\tmessage(\"bar\");\n"
"\t}\n"
"}\n"
"\n"
"extern void object::Test()\n"
"{\n"
"\tChild child();\n"
"\tchild.foo(); // Will show \"foo\"\n"
"\tchild.bar(); // Will show \"bar\"\n"
"}"
msgstr ""
#. type: Plain text
#: ../E/extends.txt:60
#, no-wrap
msgid "A parent's method can be called inside an overriden method by using the <code><a cbot|super>super</a></code> keyword."
msgstr ""
#. type: Plain text
#: ../E/class.txt:56
#, no-wrap
msgid "As shown in the previous example, the class members can be initialized in the class definition (<c/>int x = 3.33;<n/>)."
msgstr ""
#. type: Plain text
#: ../E/open.txt:13
#, no-wrap
msgid ""
"<code>\"r\"</code> mode: open for reading.\n"
"<code>\"w\"</code> mode: open for writing.\n"
"<code>\"a\"</code> mode: open for appending."
msgstr ""
#. type: Plain text
#: ../E/openfile.txt:2
#, no-wrap
msgid "<c/>openfile();<n/> opens an text file in the files/ folder. This is not a method of the <code><a cbot|file>file</a></code> class but openfile returns a <a cbot|pointer>reference</a> to a new instance of the file class. You must supply two parameters, the filename and the opening mode."
msgstr ""
#. type: Plain text
#: ../E/openfile.txt:6
#, no-wrap
msgid ""
"<code>\"r\"</code> mode: open for reading.\n"
"<code>\"w\"</code> mode: open for writing.\n"
"<code>\"w\"</code> mode: open for appending."
msgstr ""

View File

@ -53,13 +53,13 @@ msgid "Time in seconds."
msgstr "Zeit in Sekunden."
#. type: \t; header
#: ../E/abstime.txt:10 ../E/acos.txt:11 ../E/aim.txt:23 ../E/array.txt:41 ../E/asin.txt:11 ../E/atan.txt:11 ../E/atan2.txt:16 ../E/bloc.txt:48 ../E/bool.txt:4 ../E/break.txt:24 ../E/build.txt:27 ../E/buildingenabled.txt:22 ../E/busy.txt:14 ../E/canbuild.txt:22 ../E/canresearch.txt:14 ../E/category.txt:109 ../E/ceil.txt:12 ../E/class.txt:70 ../E/close.txt:6 ../E/cond.txt:4 ../E/continue.txt:24 ../E/cos.txt:11 ../E/deletef.txt:9 ../E/delinfo.txt:13 ../E/destroy.txt:15 ../E/detect.txt:27 ../E/direct.txt:13 ../E/dist.txt:29 ../E/dist2d.txt:13 ../E/do.txt:27 ../E/drop.txt:28 ../E/eof.txt:13 ../E/errmode.txt:32 ../E/expr.txt:197 ../E/extern.txt:29 ../E/factory.txt:21 ../E/false.txt:4 ../E/file.txt:16 ../E/fire.txt:30 ../E/flatgrnd.txt:16 ../E/flatspace.txt:25 ../E/float.txt:24 ../E/floor.txt:12 ../E/for.txt:51 ../E/function.txt:129 ../E/goto.txt:34 ../E/grab.txt:28 ../E/if.txt:39 ../E/int.txt:18 ../E/jet.txt:14 ../E/message.txt:24 ../E/motor.txt:38 ../E/move.txt:21 ../E/nan.txt:14 ../E/new.txt:20 ../E/null.txt:4 ../E/object.txt:79 ../E/open.txt:18 ../E/openfile.txt:10 ../E/pencolor.txt:14 ../E/pendown.txt:17 ../E/penup.txt:11 ../E/penwidth.txt:14 ../E/point.txt:35 ../E/pointer.txt:51 ../E/pow.txt:14 ../E/private.txt:17 ../E/produce.txt:30 ../E/public.txt:49 ../E/radar.txt:80 ../E/radarall.txt:19 ../E/rand.txt:8 ../E/readln.txt:18 ../E/receive.txt:16 ../E/recycle.txt:12 ../E/research.txt:18 ../E/researched.txt:14 ../E/researches.txt:27 ../E/retobj.txt:13 ../E/return.txt:29 ../E/round.txt:12 ../E/search.txt:25 ../E/send.txt:17 ../E/shield.txt:18 ../E/sin.txt:11 ../E/sizeof.txt:21 ../E/sniff.txt:16 ../E/space.txt:22 ../E/sqrt.txt:11 ../E/static.txt:20 ../E/strfind.txt:18 ../E/string.txt:32 ../E/strleft.txt:14 ../E/strlen.txt:12 ../E/strlower.txt:10 ../E/strmid.txt:18 ../E/strright.txt:14 ../E/strupper.txt:10 ../E/strval.txt:17 ../E/switch.txt:70 ../E/synchro.txt:23 ../E/takeoff.txt:15 ../E/tan.txt:11 ../E/term.txt:30 ../E/testinfo.txt:16 ../E/this.txt:52 ../E/thump.txt:12 ../E/topo.txt:13 ../E/true.txt:4 ../E/trunc.txt:12 ../E/turn.txt:32 ../E/type.txt:32 ../E/var.txt:66 ../E/void.txt:10 ../E/wait.txt:21 ../E/while.txt:46 ../E/writeln.txt:19
#: ../E/abstime.txt:10 ../E/acos.txt:11 ../E/aim.txt:23 ../E/array.txt:41 ../E/asin.txt:11 ../E/atan.txt:11 ../E/atan2.txt:16 ../E/bloc.txt:48 ../E/bool.txt:4 ../E/break.txt:24 ../E/build.txt:27 ../E/buildingenabled.txt:22 ../E/busy.txt:14 ../E/canbuild.txt:22 ../E/canresearch.txt:14 ../E/category.txt:109 ../E/ceil.txt:12 ../E/class.txt:120 ../E/close.txt:6 ../E/cond.txt:4 ../E/continue.txt:24 ../E/cos.txt:11 ../E/deletef.txt:9 ../E/delinfo.txt:13 ../E/destroy.txt:15 ../E/detect.txt:27 ../E/direct.txt:13 ../E/dist.txt:29 ../E/dist2d.txt:13 ../E/do.txt:27 ../E/drop.txt:28 ../E/eof.txt:13 ../E/errmode.txt:32 ../E/expr.txt:197 ../E/extends.txt:105 ../E/extern.txt:29 ../E/factory.txt:21 ../E/false.txt:4 ../E/file.txt:16 ../E/fire.txt:30 ../E/flatgrnd.txt:16 ../E/flatspace.txt:25 ../E/float.txt:24 ../E/floor.txt:12 ../E/for.txt:51 ../E/function.txt:129 ../E/goto.txt:34 ../E/grab.txt:28 ../E/if.txt:39 ../E/int.txt:18 ../E/jet.txt:14 ../E/message.txt:24 ../E/motor.txt:38 ../E/move.txt:21 ../E/nan.txt:14 ../E/new.txt:20 ../E/null.txt:4 ../E/object.txt:79 ../E/open.txt:19 ../E/openfile.txt:11 ../E/pencolor.txt:14 ../E/pendown.txt:17 ../E/penup.txt:11 ../E/penwidth.txt:14 ../E/point.txt:35 ../E/pointer.txt:51 ../E/pow.txt:14 ../E/private.txt:19 ../E/produce.txt:30 ../E/protected.txt:26 ../E/public.txt:49 ../E/radar.txt:80 ../E/radarall.txt:19 ../E/rand.txt:8 ../E/readln.txt:18 ../E/receive.txt:16 ../E/recycle.txt:12 ../E/research.txt:18 ../E/researched.txt:14 ../E/researches.txt:27 ../E/retobj.txt:13 ../E/return.txt:29 ../E/round.txt:12 ../E/search.txt:25 ../E/send.txt:17 ../E/shield.txt:18 ../E/sin.txt:11 ../E/sizeof.txt:21 ../E/sniff.txt:16 ../E/space.txt:22 ../E/sqrt.txt:11 ../E/static.txt:20 ../E/strfind.txt:18 ../E/string.txt:32 ../E/strleft.txt:14 ../E/strlen.txt:12 ../E/strlower.txt:10 ../E/strmid.txt:18 ../E/strright.txt:14 ../E/strupper.txt:10 ../E/strval.txt:17 ../E/super.txt:45 ../E/switch.txt:70 ../E/synchro.txt:23 ../E/takeoff.txt:15 ../E/tan.txt:11 ../E/term.txt:30 ../E/testinfo.txt:16 ../E/this.txt:52 ../E/thump.txt:12 ../E/topo.txt:13 ../E/true.txt:4 ../E/trunc.txt:12 ../E/turn.txt:32 ../E/type.txt:32 ../E/var.txt:66 ../E/void.txt:10 ../E/wait.txt:21 ../E/while.txt:46 ../E/writeln.txt:19
#, no-wrap
msgid "See also"
msgstr "Siehe auch"
#. type: Plain text
#: ../E/abstime.txt:11 ../E/aim.txt:24 ../E/array.txt:42 ../E/bool.txt:5 ../E/break.txt:25 ../E/busy.txt:15 ../E/cond.txt:5 ../E/continue.txt:25 ../E/deletef.txt:10 ../E/destroy.txt:16 ../E/detect.txt:28 ../E/direct.txt:14 ../E/dist.txt:30 ../E/dist2d.txt:14 ../E/drop.txt:29 ../E/errmode.txt:33 ../E/expr.txt:198 ../E/extern.txt:30 ../E/false.txt:5 ../E/fire.txt:31 ../E/flatgrnd.txt:17 ../E/flatspace.txt:26 ../E/float.txt:25 ../E/for.txt:52 ../E/function.txt:130 ../E/goto.txt:35 ../E/grab.txt:29 ../E/if.txt:40 ../E/int.txt:19 ../E/jet.txt:15 ../E/message.txt:25 ../E/move.txt:22 ../E/nan.txt:15 ../E/object.txt:80 ../E/openfile.txt:11 ../E/pencolor.txt:15 ../E/pendown.txt:18 ../E/penup.txt:12 ../E/penwidth.txt:15 ../E/point.txt:36 ../E/produce.txt:31 ../E/recycle.txt:13 ../E/retobj.txt:14 ../E/return.txt:30 ../E/search.txt:26 ../E/shield.txt:19 ../E/sizeof.txt:22 ../E/sniff.txt:17 ../E/space.txt:23 ../E/string.txt:33 ../E/switch.txt:71 ../E/takeoff.txt:16 ../E/term.txt:31 ../E/thump.txt:13 ../E/topo.txt:14 ../E/true.txt:5 ../E/turn.txt:33 ../E/type.txt:33 ../E/var.txt:67 ../E/void.txt:11 ../E/wait.txt:22
#: ../E/abstime.txt:11 ../E/aim.txt:24 ../E/array.txt:42 ../E/bool.txt:5 ../E/break.txt:25 ../E/busy.txt:15 ../E/cond.txt:5 ../E/continue.txt:25 ../E/deletef.txt:10 ../E/destroy.txt:16 ../E/detect.txt:28 ../E/direct.txt:14 ../E/dist.txt:30 ../E/dist2d.txt:14 ../E/drop.txt:29 ../E/errmode.txt:33 ../E/expr.txt:198 ../E/extern.txt:30 ../E/false.txt:5 ../E/fire.txt:31 ../E/flatgrnd.txt:17 ../E/flatspace.txt:26 ../E/float.txt:25 ../E/for.txt:52 ../E/function.txt:130 ../E/goto.txt:35 ../E/grab.txt:29 ../E/if.txt:40 ../E/int.txt:19 ../E/jet.txt:15 ../E/message.txt:25 ../E/move.txt:22 ../E/nan.txt:15 ../E/object.txt:80 ../E/openfile.txt:12 ../E/pencolor.txt:15 ../E/pendown.txt:18 ../E/penup.txt:12 ../E/penwidth.txt:15 ../E/point.txt:36 ../E/produce.txt:31 ../E/recycle.txt:13 ../E/retobj.txt:14 ../E/return.txt:30 ../E/search.txt:26 ../E/shield.txt:19 ../E/sizeof.txt:22 ../E/sniff.txt:17 ../E/space.txt:23 ../E/string.txt:33 ../E/switch.txt:71 ../E/takeoff.txt:16 ../E/term.txt:31 ../E/thump.txt:13 ../E/topo.txt:14 ../E/true.txt:5 ../E/turn.txt:33 ../E/type.txt:33 ../E/var.txt:67 ../E/void.txt:11 ../E/wait.txt:22
#, no-wrap
msgid "<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr "Die <a cbot>CBOT-Sprache</a>, <a cbot|type>Variablentypen</a> und <a cbot|category>Kategorien</a>."
@ -528,12 +528,6 @@ msgstr "Die <a cbot>CBOT-Sprache</a> und die <a cbot|type>Variablentypen</a>."
msgid "Instruction <code>class</code>"
msgstr "Anweisung <code>class</code>"
#. type: Plain text
#: ../E/class.txt:2
#, no-wrap
msgid "This allows you to declare a class definition using following syntax:"
msgstr "Mit dieser Anweisung können Sie eine Klasse deklarieren. Benutzen Sie folgende Syntax:"
#. type: Source code
#: ../E/class.txt:4
#, no-wrap
@ -548,164 +542,6 @@ msgstr ""
"\t<n/>Deklarationen<c/>;\n"
"}"
#. type: Plain text
#: ../E/class.txt:9
#, no-wrap
msgid "Classes can only be <a cbot|public>public</a>, that is they can be used from all bots in a mission. Class members are also public, that is they are accessible from outside the class. Class members can be fields or functions (also called methods), for example the followin class <code>MyClass</code> contains 4 fields (a, b, x and s) and one method (MyFunction)."
msgstr "Klassen können nur <a cbot|public>public</a> (öffentlich) definiert werden, das heißt, dass sie von allen Robotern der Mission benutzt werden können. Alle Glieder sind ebenfalls public, können also von außerhalb der Klasse benutzt werden. Glieder einer Klasse können Variablen oder Methoden (Funktionen) sein. Im folgenden Beispiel enthält die Klasse <code>MeineKlasse</code> vier Instanzvariablen (a, b, x und s) und eine Methode (MeineFunktion):"
#. type: Source code
#: ../E/class.txt:11
#, no-wrap
msgid ""
"public class MyClass\n"
"{\n"
"\tint a, b;\n"
"\tfloat x = 3.33;\n"
"\tstring s = \"hello\";\n"
"\tfloat MyFunction( float value )\n"
"\t{\n"
"\t\treturn (value*x)-1;\n"
"\t}\n"
"}"
msgstr ""
"public class MeineKlasse\n"
"{\n"
"\tint a, b;\n"
"\tfloat x = 3.33;\n"
"\tstring s = \"hello\";\n"
"\tfloat MeineFunktion( float value )\n"
"\t{\n"
"\t\treturn (value*x)-1;\n"
"\t}\n"
"}"
#. type: Plain text
#: ../E/class.txt:22
#, no-wrap
msgid "As shown in this exemple the class members can be initialized (<code>x=3.33</code>). You can also define a constructor which is a special method having the same name as the class name. This method will be called automatically at creation time of a class instance. You can also declare more than one method with the same name but different parameters."
msgstr "Wie in diesem Beispiel gezeigt wird, können die Variablen einer Klasse initialisiert werden (z.B. <code>x=3.33</code>). Sie können auch einen Constructor definieren, das heißt eine Methode, die denselben Namen hat wie die Klasse. Diese Methode wird automatisch aufgerufen, wenn eine neue Instanz der Klasse erstellt wird. Sie können auch mehr als eine Methode mit demselben Namen, aber mit verschiedenen Parametern definieren:"
#. type: Source code
#: ../E/class.txt:24
#, no-wrap
msgid ""
"public class MyClass\n"
"{\n"
"\tint a, b;\n"
"\tvoid MyClass( )\n"
"\t{\n"
"\t\ta = 2; b = 3;\n"
"\t}\n"
"\tvoid MyClass( int a, int b )\n"
"\t{\n"
"\t\tthis.a = a; this.b = b;\n"
"\t}\n"
"}"
msgstr ""
"public class MeineKlasse\n"
"{\n"
"\tint a, b;\n"
"\tvoid MeineKlasse ( )\n"
"\t{\n"
"\t\ta = 2; b = 3;\n"
"\t}\n"
"\tvoid MeineKlasse( int a, int b )\n"
"\t{\n"
"\t\tthis.a = a; this.b = b;\n"
"\t}\n"
"}"
#. type: Plain text
#: ../E/class.txt:37
#, no-wrap
msgid "In this example two constructors are declared for <code>MyClass</code>, one without parameters and the other one with two parameters. As the names of the parameters of the second constructor are the same as the names of the two members <code>a</code> et <code>b</code> we must use the <code><a cbot|this>this</a>.a</code> and <code><a cbot|this>this</a>.b</code> to avoid confusion with the parameters. Another more simpler solution would be to give different names to the parameters."
msgstr "In diesem Beispiel wurden für <code>MeineKlasse</code> zwei Constructor-Methoden deklariert, eine ohne Parameter, und eine mit zwei Parametern. Da die Namen der Parameter der zweiten Methode dieselben Namen haben wie die Namen der zwei Instanzvariablen <code>a</code> und <code>b</code>, muss für eine Referenz auf die Instanzvariablen <code><a cbot|this>this</a>.a</code> und <code><a cbot|this>this</a>.b</code> geschrieben werden, um einer Verwechslung vorzubeugen. Einfacher wäre es natürlich, den Parametern andere Namen zu geben."
#. type: Source code
#: ../E/class.txt:39
#, no-wrap
msgid ""
"void Test( )\n"
"{\n"
"\tMyClass item1(); // constr. w/o parameters\n"
"\tMyClass item2(4, 5); // constr. with 2 parameters\n"
"\tMyClass item3; // no constructor called,\n"
" // therefore item3 == null\n"
"}"
msgstr ""
"void Test( )\n"
"{\n"
"\tMeineKlasse item1(); // Constr. ohne Parameter\n"
"\tMeineKlasse item2(4, 5); // Constr. mit 2 Parametern\n"
"\tMeineKlasse item3; // kein Constr. aufgerufen,\n"
" // deshalb item3 == null\n"
"}"
#. type: Plain text
#: ../E/class.txt:47
#, no-wrap
msgid "You can also define a destructor. This must be a <code>void</code> fonction without parameters that has the same name as the class name but prefixed by the ~ character. The destructor is called automatically as soon as the class instance is no more referenced by anyone."
msgstr "Sie können auch einen Destructor deklarieren. Die ist eine <code>void</code>-Funktion ohne Parameter, die denselben Namen wie die Klasse hat, der aber ein \"~\"-Zeichen vorangestellt wird. Dieser Destructor wird aufgerufen, sobald sich keine Variable mehr auf diese Instanz bezieht."
#. type: Source code
#: ../E/class.txt:49
#, no-wrap
msgid ""
"public class MyClass\n"
"{\n"
"\tstatic private int counter = 0; // instance counter\n"
"\tvoid MyClass( )\n"
"\t{\n"
"\t\tcounter ++; // one instance more\n"
"\t}\n"
"\tvoid ~MyClass( )\n"
"\t{\n"
"\t\tcounter --; // one instance less\n"
"\t}\n"
"}\n"
"void Test()\n"
"{\n"
"\tMyClass item1( ); // counter = 1\n"
"\tMyClass item2( ); // counter = 2\n"
"\titem1 = null; // counter = 1\n"
"} // counter = 0"
msgstr ""
"public class MeineKlasse\n"
"{\n"
"\tstatic private int counter = 0;// Zähler f. Instanzen\n"
"\tvoid MeineKlasse( )\n"
"\t{\n"
"\t\tcounter ++; // eine Instanz mehr\n"
"\t}\n"
"\tvoid ~MeineKlasse( )\n"
"\t{\n"
"\t\tcounter --; // eine Instanz weniger\n"
"\t}\n"
"}\n"
"void Test()\n"
"{\n"
"\tMeineKlasse item1( ); // counter = 1\n"
"\tMeineKlasse item2( ); // counter = 2\n"
"\titem1 = null; // counter = 1\n"
"} // counter = 0"
#. type: Plain text
#: ../E/class.txt:68
#, no-wrap
msgid "If you pass a class instance as parameter to a <a cbot|function>function</a>, the function only receives a <a cbot|pointer>reference</a> to the instance. That means if you modify the instance in the function, the instance that has been passed to the function will be actuallay modified."
msgstr "Wenn Sie eine Klasseninstanz als Parameter an eine <a cbot|function>Funktion</a> übergeben, erhält die Funktion nur einen <a cbot|pointer>Zeiger</a> auf die Instanz. Wenn Sie also die der Funktion übergebene Instanz verändern, wird die Instanz selber verändert."
#. type: Plain text
#: ../E/class.txt:71
#, no-wrap
msgid ""
"<code><a cbot|public>public</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|static>static</a></code>, <code><a cbot|synchro>synchronized</a></code>, <code><a cbot|new>new</a></code>, <code><a cbot|pointer>reference</a></code>, <code><a cbot|this>this</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
"<code><a cbot|public>public</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|static>static</a></code>, <code><a cbot|synchro>synchronized</a></code>, <code><a cbot|new>new</a></code>, <code><a cbot|pointer>Zeiger</a></code> und <code><a cbot|this>this</a></code>.\n"
"Die <a cbot>CBOT-Sprache</a>, <a cbot|type>Variablentypen</a> und <a cbot|category>Kategorien</a>."
#. type: \b; header
#: ../E/close.txt:1
#, no-wrap
@ -2778,23 +2614,13 @@ msgstr ""
"\thandle.close();"
#. type: Plain text
#: ../E/open.txt:13 ../E/openfile.txt:6
#, no-wrap
msgid ""
"<code>\"r\"</code> mode: open for reading.\n"
"<code>\"w\"</code> mode: open for writing."
msgstr ""
"<code>\"r\"</code> Modus: öffnet die Datei im Lesemodus.\n"
"<code>\"w\"</code> Modus: öffnet die Datei im Schreibmodus."
#. type: Plain text
#: ../E/open.txt:16
#: ../E/open.txt:17
#, no-wrap
msgid "Files can only be created and opened in the files/ folder which is located in the folder where Colobot has been installed. You cannot not create or open files that are located elsewhere than in the files/ folder."
msgstr "Dateien können nur geöffnet werden, wenn sie sich im Ordner <c/>\\files\\<n/> befinden, der sich im Ordner befindet, in dem Colobot installiert wurde. Dateien in anderen Ordnern können mit diesem Befehl nicht geöffnet werden."
#. type: Plain text
#: ../E/open.txt:19
#: ../E/open.txt:20
#, no-wrap
msgid ""
"<code><a cbot|file>file</a></code>, <code><a cbot|close>close</a></code>, <code><a cbot|readln>readln</a></code>, <code><a cbot|writeln>writeln</a></code> and <code><a cbot|eof>eof</a></code>.\n"
@ -2809,12 +2635,6 @@ msgstr ""
msgid "Instruction <code>openfile</code>"
msgstr "Anweisung <code>openfile</code>"
#. type: Plain text
#: ../E/openfile.txt:2
#, no-wrap
msgid "<c/>openfile();<n/> opens an text file in the files/ folder. This is not a method of the <code><a cbot|file>file</a></code> class but openfile returne a <a cbot|pointer>reference</a> to a new instance of the file class. You must supply two parameters, the filename and the opening mode."
msgstr "<c/>openfile();<n/> öffnet eine Textdatei im Ordner \\file\\. Dies ist nicht eine Methode der Klasse <code><a cbot|file>file</a></code>, gibt aber einen <a cbot|pointer>Zeiger</a> zu einer neuen Instanz der file-Klasse zurück. Die Anweisung erhält zwei Parameter, den Dateinamen und den Öffnungsmodus."
#. type: Source code
#: ../E/openfile.txt:4
#, no-wrap
@ -3098,14 +2918,8 @@ msgstr ""
msgid "Instruction <code>private</code> (for specialists)"
msgstr "Anweisung <code>private</code> (für Spezialisten)"
#. type: Plain text
#: ../E/private.txt:2
#, no-wrap
msgid "<a cbot|class>Class</a> members can be <a cbot|public>public</a> (by default) or private. A member can be declared private by putting <code>private</code> before the type declaration of the member. Private members are not accessible from outside the class definition."
msgstr "Mitglieder einer <a cbot|class>Klasse</a> können <a cbot|public>public</a> (= öffentlich, Standardwert) oder privat sein. Um ein Mitglied als privat zu deklarieren, schreiben Sie <code>private</code> vor der Deklaration der Mitglieds. Private Mitglieder sind von außerhalb der Klassendefinition nicht sichtbar."
#. type: Source code
#: ../E/private.txt:4
#: ../E/private.txt:6
#, no-wrap
msgid ""
"public class MyClass\n"
@ -3134,16 +2948,6 @@ msgstr ""
"\tmessage( item.position ); // dies ist ein Fehler\n"
"}"
#. type: Plain text
#: ../E/private.txt:18
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|public>public</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
"<code><a cbot|class>Klassen</a></code>, <code><a cbot|public>public</a></code>.\n"
"Die <a cbot>CBOT-Sprache</a>, <a cbot|type>Variablentypen</a> und <a cbot|category>Kategorien</a>."
#. type: \b; header
#: ../E/public.txt:1
#, no-wrap
@ -3248,12 +3052,6 @@ msgstr "Wenn ein Roboter mit einer als <code>public</code> deklarierten Funktion
msgid "Instruction <code>public</code> for classes"
msgstr "Anweisung <code>public</code> für Variablen"
#. type: Plain text
#: ../E/public.txt:34
#, no-wrap
msgid "<a cbot|class>Class</a> members can be public (by default) or <a cbot|private>privat</a>. A member can be declared private by putting <code>private</code> before the member type. Private members are not accessible from outside the class definition."
msgstr "Glieder von <a cbot|class>Klassen</a> können als public (Standard) oder <a cbot|private>privat</a> deklariert werden. Private Glieder sind von außerhalb der Klassendefinition nicht sichtbar."
#. type: Source code
#: ../E/public.txt:36
#, no-wrap
@ -3284,16 +3082,6 @@ msgstr ""
"\tmessage( item.position ); // dies ist ein Fehler\n"
"}"
#. type: Plain text
#: ../E/public.txt:50
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|function>functions</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
"<code><a cbot|class>Klassen</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|function>Funktionen</a></code>\n"
"Die <a cbot>CBOT-Sprache</a>, <a cbot|type>Variablentypen</a> und <a cbot|category>Kategorien</a>."
#. type: \b; header
#: ../E/radar.txt:1
#, no-wrap
@ -4862,16 +4650,6 @@ msgstr ""
"\t}\n"
"}"
#. type: Plain text
#: ../E/this.txt:53
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
"<code><a cbot|class>Klassen</a></code>\n"
"Die <a cbot>CBOT-Sprache</a>, <a cbot|type>Variablentypen</a> und <a cbot|category>Kategorien</a>."
#. type: \b; header
#: ../E/thump.txt:1
#, no-wrap
@ -8040,7 +7818,7 @@ msgid "Firstly, the condition is valued and then the first result is returned if
msgstr ""
#. type: \t; header
#: ../E/expr.txt:157
#: ../E/expr.txt:157 ../E/extends.txt:4 ../E/extends.txt:65 ../E/private.txt:4 ../E/protected.txt:4 ../E/super.txt:4
#, no-wrap
msgid "Example"
msgstr ""
@ -8306,3 +8084,600 @@ msgid ""
" <code><a object|target1>Target1</a> </code>Flying target\n"
" <code><a object|nest>AlienNest</a> </code>Alien Nest"
msgstr ""
#. type: Plain text
#: ../E/class.txt:10
#, no-wrap
msgid "Classes can be only <a cbot|public>public</a>. This means that they can be used by all bots in a mission."
msgstr ""
#. type: \b; header
#: ../E/class.txt:12
#, no-wrap
msgid "Class Members"
msgstr ""
#. type: Plain text
#: ../E/class.txt:13
#, no-wrap
msgid "Class members are fields (<a cbot|var>variables</a>) and methods (<a cbot|function>functions</a>)."
msgstr ""
#. type: Plain text
#: ../E/class.txt:15
#, no-wrap
msgid "For example, the following class dubbed <code>MyClass</code> contains 4 fields (<code>a</code>, <code>b</code>, <code>x</code> and <code>s</code>) and one method (<code>MyFunction</code>)."
msgstr ""
#. type: Source code
#: ../E/class.txt:17
#, no-wrap
msgid ""
"public class MyClass\n"
"{\n"
"\tint a, b;\n"
"\tfloat x = 3.33;\n"
"\tstring s = \"hello\";\n"
"\tfloat MyFunction(float value)\n"
"\t{\n"
"\t\treturn (value * x) - 1;\n"
"\t}\n"
"}"
msgstr ""
#. type: \t; header
#: ../E/class.txt:55
#, no-wrap
msgid "Member Initialization"
msgstr ""
#. type: Plain text
#: ../E/class.txt:60
#, no-wrap
msgid "Example:<c/>"
msgstr ""
#. type: Source code
#: ../E/class.txt:61
#, no-wrap
msgid ""
"public class MyClass\n"
"{\n"
"\tint a, b;\n"
"\tvoid MyClass()\n"
"\t{\n"
"\t\ta = 2; b = 3;\n"
"\t}\n"
"\tvoid MyClass(int a, int b)\n"
"\t{\n"
"\t\tthis.a = a; this.b = b;\n"
"\t}\n"
"}"
msgstr ""
#. type: Plain text
#: ../E/class.txt:76
#, no-wrap
msgid "As the names of the parameters of the second constructor are the same as the names of the two members <code>a</code> and <code>b</code>, we must use the <code><a cbot|this>this</a></code> <a cbot|pointer>reference</a> to avoid confusion with the parameters' names."
msgstr ""
#. type: \b; header
#: ../E/class.txt:78
#, no-wrap
msgid "Object Creation"
msgstr ""
#. type: Plain text
#: ../E/class.txt:79
#, no-wrap
msgid "You can create objects of type <code>YourClass</code> using the <code><a cbot|new>new</a></code> keyword. Example:"
msgstr ""
#. type: \b; header
#: ../E/class.txt:90
#, no-wrap
msgid "Object Destruction"
msgstr ""
#. type: \b; header
#: ../E/class.txt:114
#, no-wrap
msgid "Passing Objects to Functions"
msgstr ""
#. type: Plain text
#: ../E/class.txt:115
#, no-wrap
msgid "Objects in CBOT are passed by <a cbot|pointer>reference</a>. This means that when an object is passed to a <a cbot|function>function</a>, the function receives a copy of a pointer to the instance, not a copy of the object, so any modifications on the object will be visible outside of the function."
msgstr ""
#. type: \b; header
#: ../E/class.txt:117
#, no-wrap
msgid "Inheritance"
msgstr ""
#. type: Plain text
#: ../E/class.txt:118
#, no-wrap
msgid "A class can inherit public and protected members of another class by using the <code><a cbot|extends>extends</a></code> keyword."
msgstr ""
#. type: Plain text
#: ../E/class.txt:2
#, no-wrap
msgid "This keyword allows you to create a class definition by using the following syntax:"
msgstr ""
#. type: \t; header
#: ../E/class.txt:9
#, no-wrap
msgid "All Classes Are Public"
msgstr ""
#. type: \t; header
#: ../E/class.txt:52
#, no-wrap
msgid "Class Members Modifiers"
msgstr ""
#. type: \t; header
#: ../E/class.txt:75
#, no-wrap
msgid "Using <code><a cbot|this>this</a></code>"
msgstr ""
#. type: Source code
#: ../E/class.txt:81
#, no-wrap
msgid ""
"extern void object::Test()\n"
"{\n"
"\tMyClass object1(); // Call default constructor (without parameters)\n"
"\tMyClass object2(4, 5); // Call constructor with two int parameters\n"
"\tMyClass object3; // No constructor called, object3 == null\n"
"\tobject3 = new MyClass(); // We call constructor now, object3 != null\n"
"}"
msgstr ""
#. type: Plain text
#: ../E/class.txt:91
#, no-wrap
msgid "You can also define a destructor. This must be a <code><a cbot|void>void</a></code> fonction without parameters, which has the same name as the class but prefixed with the <code>~</code> character. The destructor is called automatically as soon as the class instance is no more referenced by anyone. Example:"
msgstr ""
#. type: Source code
#: ../E/class.txt:93
#, no-wrap
msgid ""
"public class MyClass\n"
"{\n"
"\tstatic private int counter = 0; // instance counter\n"
"\tvoid MyClass( )\n"
"\t{\n"
"\t\tcounter++; // one instance more\n"
"\t}\n"
"\tvoid ~MyClass( )\n"
"\t{\n"
"\t\tcounter--; // one instance less\n"
"\t}\n"
"}\n"
"extern void object::Test()\n"
"{\n"
"\t // counter == 0\n"
"\tMyClass item1( ); // counter == 1\n"
"\tMyClass item2( ); // counter == 2\n"
"\titem1 = null; // counter == 1\n"
"}\n"
"// counter == 0"
msgstr ""
#. type: \b; header
#: ../E/class.txt:28
#, no-wrap
msgid "Accessing Class Members"
msgstr ""
#. type: Plain text
#: ../E/class.txt:29
#, no-wrap
msgid "Class members can be accessed outside of the class definition by using the <code>.</code> operator. Example:"
msgstr ""
#. type: Plain text
#: ../E/class.txt:50
#, no-wrap
msgid "Class members are <a cbot|public>public</a> by default, which means that they are accessible outside of the class definition. They can also be declared as <code><a cbot|private>private</a></code> or <code><a cbot|protected>protected</a></code>. Such members can only be accessed inside of the class definition."
msgstr ""
#. type: Plain text
#: ../E/class.txt:53
#, no-wrap
msgid "Fields and methods can also be declared as <code><a cbot|static>static</a></code>. Methods can be additionaly declared as <code><a cbot|synchro>synchronized</a></code>."
msgstr ""
#. type: Plain text
#: ../E/class.txt:58
#, no-wrap
msgid "Another way of initiliazing fields is by defining a constructor which is a special method having the same name as the class. This method will be called automatically at <a cbot|new>creation</a> time of a class instance. Constructors can be <a cbot|function>overloaded</a>."
msgstr ""
#. type: Source code
#: ../E/class.txt:31
#, no-wrap
msgid ""
"public class MyClass\n"
"{\n"
"\tint myField = 0;\n"
"\tint MyFunction()\n"
"\t{\n"
"\t\treturn myField * 2;\n"
"\t}\n"
"}\n"
"\n"
"extern void object::Test()\n"
"{\n"
"\tMyClass myObject();\n"
"\tmyObject.myField = 10;\n"
"\tmessage(myObject.MyFunction()); // 20\n"
"\tMyClass mySecondObject();\n"
"\tmySecondObject.myField = myObject.myField - 2;\n"
"\tmessage(mySecondObject.MyFunction()); // 16\n"
"}"
msgstr ""
#. type: Plain text
#: ../E/class.txt:121
#, no-wrap
msgid ""
"<code><a cbot|public>public</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|protected>protected</a></code>, <code><a cbot|static>static</a></code>, <code><a cbot|synchro>synchronized</a></code>, <code><a cbot|new>new</a></code>, <code><a cbot|pointer>reference</a></code>, <code><a cbot|this>this</a></code>, <code><a cbot|super>super</a></code>, <code><a cbot|extends>extends</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: \b; header
#: ../E/protected.txt:1
#, no-wrap
msgid "Keyword <code>protected</code>"
msgstr ""
#. type: Plain text
#: ../E/protected.txt:2
#, no-wrap
msgid "This is an access modifier for <a cbot|class>class</a> members. Protected class members can be accessed in a child class, but they can't be accessed outside of classes definitions being part of the same inheritance tree (see the <code><a cbot|extends>extends</a></code> keyword)."
msgstr ""
#. type: Source code
#: ../E/protected.txt:6
#, no-wrap
msgid ""
"public class Parent\n"
"{\n"
"\tprotected int field = 0;\n"
"}\n"
"\n"
"public class Child extends Parent\n"
"{\n"
"\tvoid Print()\n"
"\t{\n"
"\t\tmessage(field);\n"
"\t}\n"
"}\n"
"\n"
"extern void object::Test()\n"
"{\n"
"\tChild child();\n"
"\tchild.Print(); // 0\n"
"\t//child.field = 1; // Error!\n"
"}"
msgstr ""
#. type: Plain text
#: ../E/private.txt:2
#, no-wrap
msgid "This is an access modifier for <a cbot|class>class</a> members. Private members are not accessible outside of the class definition."
msgstr ""
#. type: Plain text
#: ../E/private.txt:20
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|public>public</a></code>, <code><a cbot|protected>protected</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: Plain text
#: ../E/public.txt:34
#, no-wrap
msgid "<code>public</code> is also an access modifier for <a cbot|class>class</a> members, which is the default one. Public members can be accessed from outside of the class definition."
msgstr ""
#. type: Plain text
#: ../E/public.txt:50
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|protected>protected</a></code>, <code><a cbot|function>functions</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: Plain text
#: ../E/protected.txt:27
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|public>public</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|extends>extends</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: \b; header
#: ../E/super.txt:1
#, no-wrap
msgid "Keyword <code>super</code>"
msgstr ""
#. type: Plain text
#: ../E/super.txt:46
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|this>this</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: Plain text
#: ../E/this.txt:53
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|super>super</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: \b; header
#: ../E/extends.txt:1
#, no-wrap
msgid "Keyword <code>extends</code>"
msgstr ""
#. type: \b; header
#: ../E/extends.txt:30
#, no-wrap
msgid "Inherited Members"
msgstr ""
#. type: Plain text
#: ../E/extends.txt:31
#, no-wrap
msgid "Only <code><a cbot|public>public</a></code> and <code><a cbot|protected>protected</a></code> members are inherited. <code><a cbot|private>private</a></code> members are directly inaccessible even for a child, although they can be accessed indirectly through inherited methods."
msgstr ""
#. type: Plain text
#: ../E/extends.txt:33
#, no-wrap
msgid "Constructors and destructors are not inherited, however, they can be overriden."
msgstr ""
#. type: \b; header
#: ../E/extends.txt:35
#, no-wrap
msgid "Method Overriding"
msgstr ""
#. type: Plain text
#: ../E/extends.txt:36
#, no-wrap
msgid "Inherited methods can be overriden (redefined) in the child class definition. Example:"
msgstr ""
#. type: Source code
#: ../E/extends.txt:38
#, no-wrap
msgid ""
"public class Parent\n"
"{\n"
"\tvoid foo()\n"
"\t{\n"
"\t\tmessage(\"foo\");\n"
"\t}\n"
"}\n"
"\n"
"public class Child extends Parent\n"
"{\n"
"\tvoid foo()\n"
"\t{\n"
"\t\tmessage(\"bar\");\n"
"\t}\n"
"}\n"
"\n"
"extern void object::Test()\n"
"{\n"
"\tChild child();\n"
"\tchild.foo(); // Will show \"bar\"\n"
"}"
msgstr ""
#. type: \b; header
#: ../E/extends.txt:62
#, no-wrap
msgid "Polymorphism"
msgstr ""
#. type: Plain text
#: ../E/extends.txt:63
#, no-wrap
msgid "<code><a cbot|pointer>Reference</a></code> of type Parent can point to an object of type Child. However, such a pointer can't be used to access a child member. In order to access a child member, it must be assured that the Parent reference really points to a Child object. If that's the case, it can be safely copied to a pointer of type Child, which has access to the child members."
msgstr ""
#. type: Source code
#: ../E/extends.txt:67
#, no-wrap
msgid ""
"public class Parent\n"
"{\n"
"\tvoid foo()\n"
"\t{\n"
"\t\tmessage(\"foo\");\n"
"\t}\n"
"}\n"
"\n"
"public class Child extends Parent\n"
"{\n"
"\tvoid foo()\n"
"\t{\n"
"\t\tmessage(\"bar\");\n"
"\t}\n"
"\tvoid bar()\n"
"\t{\n"
"\t\tmessage(\"foo bar\");\n"
"\t}\n"
"}\n"
"\n"
"extern void object::Test()\n"
"{\n"
"\tParent people[2];\n"
"\tpeople[0] = new Parent();\n"
"\tpeople[1] = new Child();\n"
"\tfor (int i = 0; i < 2; ++i)\n"
"\t{\n"
"\t\tpeople[i].foo();\n"
"\t}\n"
"\t//people[1].bar(); // Error\n"
"\tChild child = people[1];\n"
"\tchild.bar(); // OK\n"
"}"
msgstr ""
#. type: \b; header
#: ../E/extends.txt:102
#, no-wrap
msgid "Multiple Inheritance"
msgstr ""
#. type: Plain text
#: ../E/extends.txt:103
#, no-wrap
msgid "A child cannot have multiple parents, however, a parent can have many children."
msgstr ""
#. type: Plain text
#: ../E/extends.txt:106
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|public>public</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|protected>protected</a></code>, <code><a cbot|new>new</a></code>, <code><a cbot|pointer>reference</a></code>, <code><a cbot|this>this</a></code>, <code><a cbot|super>super</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: Plain text
#: ../E/super.txt:2
#, no-wrap
msgid "This keyword is similar to <code><a cbot|this>this</a></code>, however, it grants access to methods from the parent class (see the <code><a cbot|extends>extends</a></code> keyword), which is especially useful for method overriding."
msgstr ""
#. type: Source code
#: ../E/super.txt:6
#, no-wrap
msgid ""
"public class Parent\n"
"{\n"
"\tprotected int field;\n"
"\t\n"
"\tvoid Parent()\n"
"\t{\n"
"\t\tfield = 0;\n"
"\t}\n"
"\t\n"
"\tvoid Print()\n"
"\t{\n"
"\t\tmessage(\"Parent's field: \" + field);\n"
"\t}\n"
"}\n"
"\n"
"public class Child extends Parent\n"
"{\n"
"\tprivate int childsField;\n"
"\t\n"
"\tvoid Child()\n"
"\t{\n"
"\t\tsuper.Parent();\n"
"\t\tchildsField = field + 1;\n"
"\t}\n"
"\t\n"
"\tvoid Print()\n"
"\t{\n"
"\t\tsuper.Print();\n"
"\t\tmessage(\"Child's field: \" + childsField);\n"
"\t}\n"
"}\n"
"\n"
"extern void object::Test()\n"
"{\n"
"\tChild child();\n"
"\tchild.Print(); // Will show both 0 and 1\n"
"}"
msgstr ""
#. type: Plain text
#: ../E/extends.txt:2
#, no-wrap
msgid "This keyword is used in a <code><a cbot|class>class</a></code> definition when we want the class to inherit members from another class. The class which is extended we usually call a parent or base, the extending class we call a child."
msgstr ""
#. type: Source code
#: ../E/extends.txt:6
#, no-wrap
msgid ""
"public class Parent\n"
"{\n"
"\tvoid foo()\n"
"\t{\n"
"\t\tmessage(\"foo\");\n"
"\t}\n"
"}\n"
"\n"
"public class Child extends Parent\n"
"{\n"
"\tvoid bar()\n"
"\t{\n"
"\t\tmessage(\"bar\");\n"
"\t}\n"
"}\n"
"\n"
"extern void object::Test()\n"
"{\n"
"\tChild child();\n"
"\tchild.foo(); // Will show \"foo\"\n"
"\tchild.bar(); // Will show \"bar\"\n"
"}"
msgstr ""
#. type: Plain text
#: ../E/extends.txt:60
#, no-wrap
msgid "A parent's method can be called inside an overriden method by using the <code><a cbot|super>super</a></code> keyword."
msgstr ""
#. type: Plain text
#: ../E/class.txt:56
#, no-wrap
msgid "As shown in the previous example, the class members can be initialized in the class definition (<c/>int x = 3.33;<n/>)."
msgstr ""
#. type: Plain text
#: ../E/open.txt:13
#, no-wrap
msgid ""
"<code>\"r\"</code> mode: open for reading.\n"
"<code>\"w\"</code> mode: open for writing.\n"
"<code>\"a\"</code> mode: open for appending."
msgstr ""
#. type: Plain text
#: ../E/openfile.txt:2
#, no-wrap
msgid "<c/>openfile();<n/> opens an text file in the files/ folder. This is not a method of the <code><a cbot|file>file</a></code> class but openfile returns a <a cbot|pointer>reference</a> to a new instance of the file class. You must supply two parameters, the filename and the opening mode."
msgstr ""
#. type: Plain text
#: ../E/openfile.txt:6
#, no-wrap
msgid ""
"<code>\"r\"</code> mode: open for reading.\n"
"<code>\"w\"</code> mode: open for writing.\n"
"<code>\"w\"</code> mode: open for appending."
msgstr ""

View File

@ -52,13 +52,13 @@ msgid "Time in seconds."
msgstr "Temps en secondes."
#. type: \t; header
#: ../E/abstime.txt:10 ../E/acos.txt:11 ../E/aim.txt:23 ../E/array.txt:41 ../E/asin.txt:11 ../E/atan.txt:11 ../E/atan2.txt:16 ../E/bloc.txt:48 ../E/bool.txt:4 ../E/break.txt:24 ../E/build.txt:27 ../E/buildingenabled.txt:22 ../E/busy.txt:14 ../E/canbuild.txt:22 ../E/canresearch.txt:14 ../E/category.txt:109 ../E/ceil.txt:12 ../E/class.txt:70 ../E/close.txt:6 ../E/cond.txt:4 ../E/continue.txt:24 ../E/cos.txt:11 ../E/deletef.txt:9 ../E/delinfo.txt:13 ../E/destroy.txt:15 ../E/detect.txt:27 ../E/direct.txt:13 ../E/dist.txt:29 ../E/dist2d.txt:13 ../E/do.txt:27 ../E/drop.txt:28 ../E/eof.txt:13 ../E/errmode.txt:32 ../E/expr.txt:197 ../E/extern.txt:29 ../E/factory.txt:21 ../E/false.txt:4 ../E/file.txt:16 ../E/fire.txt:30 ../E/flatgrnd.txt:16 ../E/flatspace.txt:25 ../E/float.txt:24 ../E/floor.txt:12 ../E/for.txt:51 ../E/function.txt:129 ../E/goto.txt:34 ../E/grab.txt:28 ../E/if.txt:39 ../E/int.txt:18 ../E/jet.txt:14 ../E/message.txt:24 ../E/motor.txt:38 ../E/move.txt:21 ../E/nan.txt:14 ../E/new.txt:20 ../E/null.txt:4 ../E/object.txt:79 ../E/open.txt:18 ../E/openfile.txt:10 ../E/pencolor.txt:14 ../E/pendown.txt:17 ../E/penup.txt:11 ../E/penwidth.txt:14 ../E/point.txt:35 ../E/pointer.txt:51 ../E/pow.txt:14 ../E/private.txt:17 ../E/produce.txt:30 ../E/public.txt:49 ../E/radar.txt:80 ../E/radarall.txt:19 ../E/rand.txt:8 ../E/readln.txt:18 ../E/receive.txt:16 ../E/recycle.txt:12 ../E/research.txt:18 ../E/researched.txt:14 ../E/researches.txt:27 ../E/retobj.txt:13 ../E/return.txt:29 ../E/round.txt:12 ../E/search.txt:25 ../E/send.txt:17 ../E/shield.txt:18 ../E/sin.txt:11 ../E/sizeof.txt:21 ../E/sniff.txt:16 ../E/space.txt:22 ../E/sqrt.txt:11 ../E/static.txt:20 ../E/strfind.txt:18 ../E/string.txt:32 ../E/strleft.txt:14 ../E/strlen.txt:12 ../E/strlower.txt:10 ../E/strmid.txt:18 ../E/strright.txt:14 ../E/strupper.txt:10 ../E/strval.txt:17 ../E/switch.txt:70 ../E/synchro.txt:23 ../E/takeoff.txt:15 ../E/tan.txt:11 ../E/term.txt:30 ../E/testinfo.txt:16 ../E/this.txt:52 ../E/thump.txt:12 ../E/topo.txt:13 ../E/true.txt:4 ../E/trunc.txt:12 ../E/turn.txt:32 ../E/type.txt:32 ../E/var.txt:66 ../E/void.txt:10 ../E/wait.txt:21 ../E/while.txt:46 ../E/writeln.txt:19
#: ../E/abstime.txt:10 ../E/acos.txt:11 ../E/aim.txt:23 ../E/array.txt:41 ../E/asin.txt:11 ../E/atan.txt:11 ../E/atan2.txt:16 ../E/bloc.txt:48 ../E/bool.txt:4 ../E/break.txt:24 ../E/build.txt:27 ../E/buildingenabled.txt:22 ../E/busy.txt:14 ../E/canbuild.txt:22 ../E/canresearch.txt:14 ../E/category.txt:109 ../E/ceil.txt:12 ../E/class.txt:120 ../E/close.txt:6 ../E/cond.txt:4 ../E/continue.txt:24 ../E/cos.txt:11 ../E/deletef.txt:9 ../E/delinfo.txt:13 ../E/destroy.txt:15 ../E/detect.txt:27 ../E/direct.txt:13 ../E/dist.txt:29 ../E/dist2d.txt:13 ../E/do.txt:27 ../E/drop.txt:28 ../E/eof.txt:13 ../E/errmode.txt:32 ../E/expr.txt:197 ../E/extends.txt:105 ../E/extern.txt:29 ../E/factory.txt:21 ../E/false.txt:4 ../E/file.txt:16 ../E/fire.txt:30 ../E/flatgrnd.txt:16 ../E/flatspace.txt:25 ../E/float.txt:24 ../E/floor.txt:12 ../E/for.txt:51 ../E/function.txt:129 ../E/goto.txt:34 ../E/grab.txt:28 ../E/if.txt:39 ../E/int.txt:18 ../E/jet.txt:14 ../E/message.txt:24 ../E/motor.txt:38 ../E/move.txt:21 ../E/nan.txt:14 ../E/new.txt:20 ../E/null.txt:4 ../E/object.txt:79 ../E/open.txt:19 ../E/openfile.txt:11 ../E/pencolor.txt:14 ../E/pendown.txt:17 ../E/penup.txt:11 ../E/penwidth.txt:14 ../E/point.txt:35 ../E/pointer.txt:51 ../E/pow.txt:14 ../E/private.txt:19 ../E/produce.txt:30 ../E/protected.txt:26 ../E/public.txt:49 ../E/radar.txt:80 ../E/radarall.txt:19 ../E/rand.txt:8 ../E/readln.txt:18 ../E/receive.txt:16 ../E/recycle.txt:12 ../E/research.txt:18 ../E/researched.txt:14 ../E/researches.txt:27 ../E/retobj.txt:13 ../E/return.txt:29 ../E/round.txt:12 ../E/search.txt:25 ../E/send.txt:17 ../E/shield.txt:18 ../E/sin.txt:11 ../E/sizeof.txt:21 ../E/sniff.txt:16 ../E/space.txt:22 ../E/sqrt.txt:11 ../E/static.txt:20 ../E/strfind.txt:18 ../E/string.txt:32 ../E/strleft.txt:14 ../E/strlen.txt:12 ../E/strlower.txt:10 ../E/strmid.txt:18 ../E/strright.txt:14 ../E/strupper.txt:10 ../E/strval.txt:17 ../E/super.txt:45 ../E/switch.txt:70 ../E/synchro.txt:23 ../E/takeoff.txt:15 ../E/tan.txt:11 ../E/term.txt:30 ../E/testinfo.txt:16 ../E/this.txt:52 ../E/thump.txt:12 ../E/topo.txt:13 ../E/true.txt:4 ../E/trunc.txt:12 ../E/turn.txt:32 ../E/type.txt:32 ../E/var.txt:66 ../E/void.txt:10 ../E/wait.txt:21 ../E/while.txt:46 ../E/writeln.txt:19
#, no-wrap
msgid "See also"
msgstr "Voir aussi"
#. type: Plain text
#: ../E/abstime.txt:11 ../E/aim.txt:24 ../E/array.txt:42 ../E/bool.txt:5 ../E/break.txt:25 ../E/busy.txt:15 ../E/cond.txt:5 ../E/continue.txt:25 ../E/deletef.txt:10 ../E/destroy.txt:16 ../E/detect.txt:28 ../E/direct.txt:14 ../E/dist.txt:30 ../E/dist2d.txt:14 ../E/drop.txt:29 ../E/errmode.txt:33 ../E/expr.txt:198 ../E/extern.txt:30 ../E/false.txt:5 ../E/fire.txt:31 ../E/flatgrnd.txt:17 ../E/flatspace.txt:26 ../E/float.txt:25 ../E/for.txt:52 ../E/function.txt:130 ../E/goto.txt:35 ../E/grab.txt:29 ../E/if.txt:40 ../E/int.txt:19 ../E/jet.txt:15 ../E/message.txt:25 ../E/move.txt:22 ../E/nan.txt:15 ../E/object.txt:80 ../E/openfile.txt:11 ../E/pencolor.txt:15 ../E/pendown.txt:18 ../E/penup.txt:12 ../E/penwidth.txt:15 ../E/point.txt:36 ../E/produce.txt:31 ../E/recycle.txt:13 ../E/retobj.txt:14 ../E/return.txt:30 ../E/search.txt:26 ../E/shield.txt:19 ../E/sizeof.txt:22 ../E/sniff.txt:17 ../E/space.txt:23 ../E/string.txt:33 ../E/switch.txt:71 ../E/takeoff.txt:16 ../E/term.txt:31 ../E/thump.txt:13 ../E/topo.txt:14 ../E/true.txt:5 ../E/turn.txt:33 ../E/type.txt:33 ../E/var.txt:67 ../E/void.txt:11 ../E/wait.txt:22
#: ../E/abstime.txt:11 ../E/aim.txt:24 ../E/array.txt:42 ../E/bool.txt:5 ../E/break.txt:25 ../E/busy.txt:15 ../E/cond.txt:5 ../E/continue.txt:25 ../E/deletef.txt:10 ../E/destroy.txt:16 ../E/detect.txt:28 ../E/direct.txt:14 ../E/dist.txt:30 ../E/dist2d.txt:14 ../E/drop.txt:29 ../E/errmode.txt:33 ../E/expr.txt:198 ../E/extern.txt:30 ../E/false.txt:5 ../E/fire.txt:31 ../E/flatgrnd.txt:17 ../E/flatspace.txt:26 ../E/float.txt:25 ../E/for.txt:52 ../E/function.txt:130 ../E/goto.txt:35 ../E/grab.txt:29 ../E/if.txt:40 ../E/int.txt:19 ../E/jet.txt:15 ../E/message.txt:25 ../E/move.txt:22 ../E/nan.txt:15 ../E/object.txt:80 ../E/openfile.txt:12 ../E/pencolor.txt:15 ../E/pendown.txt:18 ../E/penup.txt:12 ../E/penwidth.txt:15 ../E/point.txt:36 ../E/produce.txt:31 ../E/recycle.txt:13 ../E/retobj.txt:14 ../E/return.txt:30 ../E/search.txt:26 ../E/shield.txt:19 ../E/sizeof.txt:22 ../E/sniff.txt:17 ../E/space.txt:23 ../E/string.txt:33 ../E/switch.txt:71 ../E/takeoff.txt:16 ../E/term.txt:31 ../E/thump.txt:13 ../E/topo.txt:14 ../E/true.txt:5 ../E/turn.txt:33 ../E/type.txt:33 ../E/var.txt:67 ../E/void.txt:11 ../E/wait.txt:22
#, no-wrap
msgid "<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr "<a cbot>Programmation</a>, <a cbot|type>types</a> et <a cbot|category>catégories</a>."
@ -581,12 +581,6 @@ msgstr "<a cbot>Programmation</a> et <a cbot|type>types</a>."
msgid "Instruction <code>class</code>"
msgstr "Instruction <code>class</code> (pour spécialistes)"
#. type: Plain text
#: ../E/class.txt:2
#, no-wrap
msgid "This allows you to declare a class definition using following syntax:"
msgstr "La syntaxe pour déclarer une classe est la suivante:"
#. type: Source code
#: ../E/class.txt:4
#, no-wrap
@ -601,162 +595,6 @@ msgstr ""
"\tdéclarations;\n"
"}"
#. type: Plain text
#: ../E/class.txt:9
#, no-wrap
msgid "Classes can only be <a cbot|public>public</a>, that is they can be used from all bots in a mission. Class members are also public, that is they are accessible from outside the class. Class members can be fields or functions (also called methods), for example the followin class <code>MyClass</code> contains 4 fields (a, b, x and s) and one method (MyFunction)."
msgstr "La classe est d'office <a cbot|public>publique</a> (disponible partout). Les membres de la classe sont également publiques (disponible à tous). Les déclarations peuvent être des déclarations de champs ou des déclarations de méthodes (avec le <a cbot|bloc>bloc</a> d'exécution). Une classe peut contenir des <a cbot|var>variables</a> et des <a cbot|function>fonctions</a>. Mais dans la terminologie des langages orientés objets, on les appelle \"champs\" et \"méthodes\". Le terme \"membre\" désigne un champ ou une méthode."
#. type: Source code
#: ../E/class.txt:11
#, no-wrap
msgid ""
"public class MyClass\n"
"{\n"
"\tint a, b;\n"
"\tfloat x = 3.33;\n"
"\tstring s = \"hello\";\n"
"\tfloat MyFunction( float value )\n"
"\t{\n"
"\t\treturn (value*x)-1;\n"
"\t}\n"
"}"
msgstr ""
"public class MaClasse\n"
"{\n"
"\tint a, b;\n"
"\tfloat x = 3.33;\n"
"\tstring s = \"hello\";\n"
"\tfloat MaPrimitive( float value )\n"
"\t{\n"
"\t\treturn (value*x)-1;\n"
"\t}\n"
"}"
#. type: Plain text
#: ../E/class.txt:22
#, no-wrap
msgid "As shown in this exemple the class members can be initialized (<code>x=3.33</code>). You can also define a constructor which is a special method having the same name as the class name. This method will be called automatically at creation time of a class instance. You can also declare more than one method with the same name but different parameters."
msgstr ""
"Comme le montre cet exemple, il est possible d'initialiser la valeur des champs par défaut (<code>x=3.33</code>), ce qui rend le constructeur inutile. Toutefois, il est possible de définir un constructeur, en créant une méthode (de type <code>void</code>) ayant le même nom que la classe.\n"
"Il est également possible de définir plusieurs méthodes ayant le même nom, mais avec des paramètres différents (ce qui est aussi valable pour les <a cbot|function>fonctions</a>)."
#. type: Source code
#: ../E/class.txt:24
#, no-wrap
msgid ""
"public class MyClass\n"
"{\n"
"\tint a, b;\n"
"\tvoid MyClass( )\n"
"\t{\n"
"\t\ta = 2; b = 3;\n"
"\t}\n"
"\tvoid MyClass( int a, int b )\n"
"\t{\n"
"\t\tthis.a = a; this.b = b;\n"
"\t}\n"
"}"
msgstr ""
"public class MaClasse\n"
"{\n"
"\tint a, b;\n"
"\tvoid MaClasse( )\n"
"\t{\n"
"\t\ta = 2; b = 3;\n"
"\t}\n"
"\tvoid MaClasse( int a, int b )\n"
"\t{\n"
"\t\tthis.a = a; this.b = b;\n"
"\t}\n"
"}"
#. type: Plain text
#: ../E/class.txt:37
#, no-wrap
msgid "In this example two constructors are declared for <code>MyClass</code>, one without parameters and the other one with two parameters. As the names of the parameters of the second constructor are the same as the names of the two members <code>a</code> et <code>b</code> we must use the <code><a cbot|this>this</a>.a</code> and <code><a cbot|this>this</a>.b</code> to avoid confusion with the parameters. Another more simpler solution would be to give different names to the parameters."
msgstr ""
"Cet exemple déclare deux constructeurs pour <code>MaClasse</code>, l'un sans paramètre, l'autre avec deux paramètres. Comme les paramètres ont été nommés avec le même nom que les éléments <code>a</code> et <code>b</code>, il est nécessaire d'utiliser <code><a cbot|this>this</a>.a</code> et <code><a cbot|this>this</a>.b</code> pour accéder aux éléments de l'instance (une solution plus simple consiste à donner des noms différents pour les paramètres).\n"
"Les constructeurs sont appelés automatiquement à la définition d'une instance de la classe."
#. type: Source code
#: ../E/class.txt:39
#, no-wrap
msgid ""
"void Test( )\n"
"{\n"
"\tMyClass item1(); // constr. w/o parameters\n"
"\tMyClass item2(4, 5); // constr. with 2 parameters\n"
"\tMyClass item3; // no constructor called,\n"
" // therefore item3 == null\n"
"}"
msgstr ""
"void Test( )\n"
"{\n"
"\tMaClasse item1(); // constr. sans paramètre\n"
"\tMaClasse item2(4, 5); // constr. avec 2 paramètres\n"
"\tMaClasse item3; // pas de constructeur,\n"
" // item3 == null\n"
"}"
#. type: Plain text
#: ../E/class.txt:47
#, no-wrap
msgid "You can also define a destructor. This must be a <code>void</code> fonction without parameters that has the same name as the class name but prefixed by the ~ character. The destructor is called automatically as soon as the class instance is no more referenced by anyone."
msgstr "Un destructeur peut être également défini. C'est une méthode <code>void</code> sans paramètre ayant le nom de la classe précédé du caractère \"tilde\" ~. Le destructeur est appelé dès qu'il n'y a plus aucune <a cbot|pointer>référence</a> vers une instance donnée."
#. type: Source code
#: ../E/class.txt:49
#, no-wrap
msgid ""
"public class MyClass\n"
"{\n"
"\tstatic private int counter = 0; // instance counter\n"
"\tvoid MyClass( )\n"
"\t{\n"
"\t\tcounter ++; // one instance more\n"
"\t}\n"
"\tvoid ~MyClass( )\n"
"\t{\n"
"\t\tcounter --; // one instance less\n"
"\t}\n"
"}\n"
"void Test()\n"
"{\n"
"\tMyClass item1( ); // counter = 1\n"
"\tMyClass item2( ); // counter = 2\n"
"\titem1 = null; // counter = 1\n"
"} // counter = 0"
msgstr ""
"public class MaClasse\n"
"{\n"
"\tstatic private int compteur = 0;\n"
"\tvoid MaClasse( ) { compteur ++ ); // compte\n"
"\tvoid ~MaClasse( ) { compteur -- }; // décompte\n"
"}\n"
"void Test()\n"
"{\n"
"\tMaClasse item1( ); // compteur = 1\n"
"\tMaClasse item2( ); // compteur = 2\n"
"\titem1 = null; // compteur = 1\n"
"} // compteur = 0"
#. type: Plain text
#: ../E/class.txt:68
#, no-wrap
msgid "If you pass a class instance as parameter to a <a cbot|function>function</a>, the function only receives a <a cbot|pointer>reference</a> to the instance. That means if you modify the instance in the function, the instance that has been passed to the function will be actuallay modified."
msgstr "Lorsqu'on donne l'instance d'une classe comme paramètre d'une <a cbot|function>fonction</a>, c'est toujours la <a cbot|pointer>référence</a> qui est passée."
#. type: Plain text
#: ../E/class.txt:71
#, no-wrap
msgid ""
"<code><a cbot|public>public</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|static>static</a></code>, <code><a cbot|synchro>synchronized</a></code>, <code><a cbot|new>new</a></code>, <code><a cbot|pointer>reference</a></code>, <code><a cbot|this>this</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
"<code><a cbot|public>public</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|static>static</a></code>, <code><a cbot|synchro>synchronized</a></code>, <code><a cbot|new>new</a></code>, <code><a cbot|pointer>pointer</a></code>\n"
"<a cbot>Programmation</a>, <a cbot|type>types</a> et <a cbot|category>catégories</a>."
#. type: \b; header
#: ../E/close.txt:1
#, no-wrap
@ -2822,23 +2660,13 @@ msgstr ""
"\thandle.close();"
#. type: Plain text
#: ../E/open.txt:13 ../E/openfile.txt:6
#, no-wrap
msgid ""
"<code>\"r\"</code> mode: open for reading.\n"
"<code>\"w\"</code> mode: open for writing."
msgstr ""
"Le mode <code>\"r\"</code> permet d'ouvrir le fichier en lecture (read).\n"
"Le mode <code>\"w\"</code> permet d'ouvrir le fichier en écriture (write)."
#. type: Plain text
#: ../E/open.txt:16
#: ../E/open.txt:17
#, no-wrap
msgid "Files can only be created and opened in the files/ folder which is located in the folder where Colobot has been installed. You cannot not create or open files that are located elsewhere than in the files/ folder."
msgstr "Les fichiers ne peuvent être créés et ouverts que dans le dossier files/, situé là où Colobot a été installé. Il n'est pas possible de créer ou ouvrir des fichiers situés ailleurs que dans ce dossier files/."
#. type: Plain text
#: ../E/open.txt:19
#: ../E/open.txt:20
#, no-wrap
msgid ""
"<code><a cbot|file>file</a></code>, <code><a cbot|close>close</a></code>, <code><a cbot|readln>readln</a></code>, <code><a cbot|writeln>writeln</a></code> and <code><a cbot|eof>eof</a></code>.\n"
@ -2853,12 +2681,6 @@ msgstr ""
msgid "Instruction <code>openfile</code>"
msgstr "Instruction <code>openfile</code>"
#. type: Plain text
#: ../E/openfile.txt:2
#, no-wrap
msgid "<c/>openfile();<n/> opens an text file in the files/ folder. This is not a method of the <code><a cbot|file>file</a></code> class but openfile returne a <a cbot|pointer>reference</a> to a new instance of the file class. You must supply two parameters, the filename and the opening mode."
msgstr "L'instruction <c/>openfile();<n/> ouvre un fichier de texte dans le dossier files/. Elle ne fait pas partie de la classe <code><a cbot|file>file</a></code> mais retourne une <a cbot|pointer>référence</a> à une instance de cette classe avec le fichier ouvert. Cette fonction demande deux paramètres: le nom du fichier et le mode d'ouverture."
#. type: Source code
#: ../E/openfile.txt:4
#, no-wrap
@ -3136,14 +2958,8 @@ msgstr "<a cbot>Programmation</a>, <a cbot|type>types</a> et <a cbot|category>ca
msgid "Instruction <code>private</code> (for specialists)"
msgstr "Instruction <code>private</code> (pour spécialistes)"
#. type: Plain text
#: ../E/private.txt:2
#, no-wrap
msgid "<a cbot|class>Class</a> members can be <a cbot|public>public</a> (by default) or private. A member can be declared private by putting <code>private</code> before the type declaration of the member. Private members are not accessible from outside the class definition."
msgstr "Les éléments déclarés dans une <a cbot|class>classe</a> peuvent être <a cbot|public>publics</a> (par défaut) ou privés. Un élément est privé en plaçant <code>private</code> devant le type de l'élément. Dès lors, ces éléments ne seront plus accessibles depuis l'extérieur de la définition de la classe elle-même."
#. type: Source code
#: ../E/private.txt:4
#: ../E/private.txt:6
#, no-wrap
msgid ""
"public class MyClass\n"
@ -3172,16 +2988,6 @@ msgstr ""
"\tmessage( item.position ); // erreur élément non accessible\n"
"}"
#. type: Plain text
#: ../E/private.txt:18
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|public>public</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
"<code><a cbot|class>class</a></code>, <code><a cbot|public>public</a></code>\n"
"<a cbot>Programmation</a>, <a cbot|type>types</a> et <a cbot|category>catégories</a>."
#. type: \b; header
#: ../E/public.txt:1
#, no-wrap
@ -3286,12 +3092,6 @@ msgstr "Si le robot qui contenait la fonction déclarée <code>public</code> est
msgid "Instruction <code>public</code> for classes"
msgstr "Instruction <code>public</code> pour les classes"
#. type: Plain text
#: ../E/public.txt:34
#, no-wrap
msgid "<a cbot|class>Class</a> members can be public (by default) or <a cbot|private>privat</a>. A member can be declared private by putting <code>private</code> before the member type. Private members are not accessible from outside the class definition."
msgstr "Les éléments déclarés dans une <a cbot|class>classe</a> peuvent être publics (par défaut) ou <a cbot|private>privés</a>. Un élément est privé en plaçant <code>private</code> devant le type de l'élément. Dès lors, ces éléments ne seront plus accessibles depuis l'extérieur de la définition de la classe elle-même."
#. type: Source code
#: ../E/public.txt:36
#, no-wrap
@ -3322,16 +3122,6 @@ msgstr ""
"\tmessage( item.position ); // erreur\n"
"}"
#. type: Plain text
#: ../E/public.txt:50
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|function>functions</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
"<code><a cbot|class>class</a></code>, <code><a cbot|private>private</a></code>\n"
"<a cbot>Programmation</a>, <a cbot|type>types</a> et <a cbot|category>catégories</a>."
#. type: \b; header
#: ../E/radar.txt:1
#, no-wrap
@ -4915,14 +4705,6 @@ msgstr ""
"\t}\n"
"}"
#. type: Plain text
#: ../E/this.txt:53
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr "<a cbot>Programmation</a>, <a cbot|type>types</a> et <a cbot|category>catégories</a>."
#. type: \b; header
#: ../E/thump.txt:1
#, no-wrap
@ -8030,7 +7812,7 @@ msgid "Firstly, the condition is valued and then the first result is returned if
msgstr ""
#. type: \t; header
#: ../E/expr.txt:157
#: ../E/expr.txt:157 ../E/extends.txt:4 ../E/extends.txt:65 ../E/private.txt:4 ../E/protected.txt:4 ../E/super.txt:4
#, no-wrap
msgid "Example"
msgstr ""
@ -8303,3 +8085,600 @@ msgid ""
" <code><a object|target1>Target1</a> </code>Flying target\n"
" <code><a object|nest>AlienNest</a> </code>Alien Nest"
msgstr ""
#. type: Plain text
#: ../E/class.txt:10
#, no-wrap
msgid "Classes can be only <a cbot|public>public</a>. This means that they can be used by all bots in a mission."
msgstr ""
#. type: \b; header
#: ../E/class.txt:12
#, no-wrap
msgid "Class Members"
msgstr ""
#. type: Plain text
#: ../E/class.txt:13
#, no-wrap
msgid "Class members are fields (<a cbot|var>variables</a>) and methods (<a cbot|function>functions</a>)."
msgstr ""
#. type: Plain text
#: ../E/class.txt:15
#, no-wrap
msgid "For example, the following class dubbed <code>MyClass</code> contains 4 fields (<code>a</code>, <code>b</code>, <code>x</code> and <code>s</code>) and one method (<code>MyFunction</code>)."
msgstr ""
#. type: Source code
#: ../E/class.txt:17
#, no-wrap
msgid ""
"public class MyClass\n"
"{\n"
"\tint a, b;\n"
"\tfloat x = 3.33;\n"
"\tstring s = \"hello\";\n"
"\tfloat MyFunction(float value)\n"
"\t{\n"
"\t\treturn (value * x) - 1;\n"
"\t}\n"
"}"
msgstr ""
#. type: \t; header
#: ../E/class.txt:55
#, no-wrap
msgid "Member Initialization"
msgstr ""
#. type: Plain text
#: ../E/class.txt:60
#, no-wrap
msgid "Example:<c/>"
msgstr ""
#. type: Source code
#: ../E/class.txt:61
#, no-wrap
msgid ""
"public class MyClass\n"
"{\n"
"\tint a, b;\n"
"\tvoid MyClass()\n"
"\t{\n"
"\t\ta = 2; b = 3;\n"
"\t}\n"
"\tvoid MyClass(int a, int b)\n"
"\t{\n"
"\t\tthis.a = a; this.b = b;\n"
"\t}\n"
"}"
msgstr ""
#. type: Plain text
#: ../E/class.txt:76
#, no-wrap
msgid "As the names of the parameters of the second constructor are the same as the names of the two members <code>a</code> and <code>b</code>, we must use the <code><a cbot|this>this</a></code> <a cbot|pointer>reference</a> to avoid confusion with the parameters' names."
msgstr ""
#. type: \b; header
#: ../E/class.txt:78
#, no-wrap
msgid "Object Creation"
msgstr ""
#. type: Plain text
#: ../E/class.txt:79
#, no-wrap
msgid "You can create objects of type <code>YourClass</code> using the <code><a cbot|new>new</a></code> keyword. Example:"
msgstr ""
#. type: \b; header
#: ../E/class.txt:90
#, no-wrap
msgid "Object Destruction"
msgstr ""
#. type: \b; header
#: ../E/class.txt:114
#, no-wrap
msgid "Passing Objects to Functions"
msgstr ""
#. type: Plain text
#: ../E/class.txt:115
#, no-wrap
msgid "Objects in CBOT are passed by <a cbot|pointer>reference</a>. This means that when an object is passed to a <a cbot|function>function</a>, the function receives a copy of a pointer to the instance, not a copy of the object, so any modifications on the object will be visible outside of the function."
msgstr ""
#. type: \b; header
#: ../E/class.txt:117
#, no-wrap
msgid "Inheritance"
msgstr ""
#. type: Plain text
#: ../E/class.txt:118
#, no-wrap
msgid "A class can inherit public and protected members of another class by using the <code><a cbot|extends>extends</a></code> keyword."
msgstr ""
#. type: Plain text
#: ../E/class.txt:2
#, no-wrap
msgid "This keyword allows you to create a class definition by using the following syntax:"
msgstr ""
#. type: \t; header
#: ../E/class.txt:9
#, no-wrap
msgid "All Classes Are Public"
msgstr ""
#. type: \t; header
#: ../E/class.txt:52
#, no-wrap
msgid "Class Members Modifiers"
msgstr ""
#. type: \t; header
#: ../E/class.txt:75
#, no-wrap
msgid "Using <code><a cbot|this>this</a></code>"
msgstr ""
#. type: Source code
#: ../E/class.txt:81
#, no-wrap
msgid ""
"extern void object::Test()\n"
"{\n"
"\tMyClass object1(); // Call default constructor (without parameters)\n"
"\tMyClass object2(4, 5); // Call constructor with two int parameters\n"
"\tMyClass object3; // No constructor called, object3 == null\n"
"\tobject3 = new MyClass(); // We call constructor now, object3 != null\n"
"}"
msgstr ""
#. type: Plain text
#: ../E/class.txt:91
#, no-wrap
msgid "You can also define a destructor. This must be a <code><a cbot|void>void</a></code> fonction without parameters, which has the same name as the class but prefixed with the <code>~</code> character. The destructor is called automatically as soon as the class instance is no more referenced by anyone. Example:"
msgstr ""
#. type: Source code
#: ../E/class.txt:93
#, no-wrap
msgid ""
"public class MyClass\n"
"{\n"
"\tstatic private int counter = 0; // instance counter\n"
"\tvoid MyClass( )\n"
"\t{\n"
"\t\tcounter++; // one instance more\n"
"\t}\n"
"\tvoid ~MyClass( )\n"
"\t{\n"
"\t\tcounter--; // one instance less\n"
"\t}\n"
"}\n"
"extern void object::Test()\n"
"{\n"
"\t // counter == 0\n"
"\tMyClass item1( ); // counter == 1\n"
"\tMyClass item2( ); // counter == 2\n"
"\titem1 = null; // counter == 1\n"
"}\n"
"// counter == 0"
msgstr ""
#. type: \b; header
#: ../E/class.txt:28
#, no-wrap
msgid "Accessing Class Members"
msgstr ""
#. type: Plain text
#: ../E/class.txt:29
#, no-wrap
msgid "Class members can be accessed outside of the class definition by using the <code>.</code> operator. Example:"
msgstr ""
#. type: Plain text
#: ../E/class.txt:50
#, no-wrap
msgid "Class members are <a cbot|public>public</a> by default, which means that they are accessible outside of the class definition. They can also be declared as <code><a cbot|private>private</a></code> or <code><a cbot|protected>protected</a></code>. Such members can only be accessed inside of the class definition."
msgstr ""
#. type: Plain text
#: ../E/class.txt:53
#, no-wrap
msgid "Fields and methods can also be declared as <code><a cbot|static>static</a></code>. Methods can be additionaly declared as <code><a cbot|synchro>synchronized</a></code>."
msgstr ""
#. type: Plain text
#: ../E/class.txt:58
#, no-wrap
msgid "Another way of initiliazing fields is by defining a constructor which is a special method having the same name as the class. This method will be called automatically at <a cbot|new>creation</a> time of a class instance. Constructors can be <a cbot|function>overloaded</a>."
msgstr ""
#. type: Source code
#: ../E/class.txt:31
#, no-wrap
msgid ""
"public class MyClass\n"
"{\n"
"\tint myField = 0;\n"
"\tint MyFunction()\n"
"\t{\n"
"\t\treturn myField * 2;\n"
"\t}\n"
"}\n"
"\n"
"extern void object::Test()\n"
"{\n"
"\tMyClass myObject();\n"
"\tmyObject.myField = 10;\n"
"\tmessage(myObject.MyFunction()); // 20\n"
"\tMyClass mySecondObject();\n"
"\tmySecondObject.myField = myObject.myField - 2;\n"
"\tmessage(mySecondObject.MyFunction()); // 16\n"
"}"
msgstr ""
#. type: Plain text
#: ../E/class.txt:121
#, no-wrap
msgid ""
"<code><a cbot|public>public</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|protected>protected</a></code>, <code><a cbot|static>static</a></code>, <code><a cbot|synchro>synchronized</a></code>, <code><a cbot|new>new</a></code>, <code><a cbot|pointer>reference</a></code>, <code><a cbot|this>this</a></code>, <code><a cbot|super>super</a></code>, <code><a cbot|extends>extends</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: \b; header
#: ../E/protected.txt:1
#, no-wrap
msgid "Keyword <code>protected</code>"
msgstr ""
#. type: Plain text
#: ../E/protected.txt:2
#, no-wrap
msgid "This is an access modifier for <a cbot|class>class</a> members. Protected class members can be accessed in a child class, but they can't be accessed outside of classes definitions being part of the same inheritance tree (see the <code><a cbot|extends>extends</a></code> keyword)."
msgstr ""
#. type: Source code
#: ../E/protected.txt:6
#, no-wrap
msgid ""
"public class Parent\n"
"{\n"
"\tprotected int field = 0;\n"
"}\n"
"\n"
"public class Child extends Parent\n"
"{\n"
"\tvoid Print()\n"
"\t{\n"
"\t\tmessage(field);\n"
"\t}\n"
"}\n"
"\n"
"extern void object::Test()\n"
"{\n"
"\tChild child();\n"
"\tchild.Print(); // 0\n"
"\t//child.field = 1; // Error!\n"
"}"
msgstr ""
#. type: Plain text
#: ../E/private.txt:2
#, no-wrap
msgid "This is an access modifier for <a cbot|class>class</a> members. Private members are not accessible outside of the class definition."
msgstr ""
#. type: Plain text
#: ../E/private.txt:20
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|public>public</a></code>, <code><a cbot|protected>protected</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: Plain text
#: ../E/public.txt:34
#, no-wrap
msgid "<code>public</code> is also an access modifier for <a cbot|class>class</a> members, which is the default one. Public members can be accessed from outside of the class definition."
msgstr ""
#. type: Plain text
#: ../E/public.txt:50
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|protected>protected</a></code>, <code><a cbot|function>functions</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: Plain text
#: ../E/protected.txt:27
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|public>public</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|extends>extends</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: \b; header
#: ../E/super.txt:1
#, no-wrap
msgid "Keyword <code>super</code>"
msgstr ""
#. type: Plain text
#: ../E/super.txt:46
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|this>this</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: Plain text
#: ../E/this.txt:53
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|super>super</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: \b; header
#: ../E/extends.txt:1
#, no-wrap
msgid "Keyword <code>extends</code>"
msgstr ""
#. type: \b; header
#: ../E/extends.txt:30
#, no-wrap
msgid "Inherited Members"
msgstr ""
#. type: Plain text
#: ../E/extends.txt:31
#, no-wrap
msgid "Only <code><a cbot|public>public</a></code> and <code><a cbot|protected>protected</a></code> members are inherited. <code><a cbot|private>private</a></code> members are directly inaccessible even for a child, although they can be accessed indirectly through inherited methods."
msgstr ""
#. type: Plain text
#: ../E/extends.txt:33
#, no-wrap
msgid "Constructors and destructors are not inherited, however, they can be overriden."
msgstr ""
#. type: \b; header
#: ../E/extends.txt:35
#, no-wrap
msgid "Method Overriding"
msgstr ""
#. type: Plain text
#: ../E/extends.txt:36
#, no-wrap
msgid "Inherited methods can be overriden (redefined) in the child class definition. Example:"
msgstr ""
#. type: Source code
#: ../E/extends.txt:38
#, no-wrap
msgid ""
"public class Parent\n"
"{\n"
"\tvoid foo()\n"
"\t{\n"
"\t\tmessage(\"foo\");\n"
"\t}\n"
"}\n"
"\n"
"public class Child extends Parent\n"
"{\n"
"\tvoid foo()\n"
"\t{\n"
"\t\tmessage(\"bar\");\n"
"\t}\n"
"}\n"
"\n"
"extern void object::Test()\n"
"{\n"
"\tChild child();\n"
"\tchild.foo(); // Will show \"bar\"\n"
"}"
msgstr ""
#. type: \b; header
#: ../E/extends.txt:62
#, no-wrap
msgid "Polymorphism"
msgstr ""
#. type: Plain text
#: ../E/extends.txt:63
#, no-wrap
msgid "<code><a cbot|pointer>Reference</a></code> of type Parent can point to an object of type Child. However, such a pointer can't be used to access a child member. In order to access a child member, it must be assured that the Parent reference really points to a Child object. If that's the case, it can be safely copied to a pointer of type Child, which has access to the child members."
msgstr ""
#. type: Source code
#: ../E/extends.txt:67
#, no-wrap
msgid ""
"public class Parent\n"
"{\n"
"\tvoid foo()\n"
"\t{\n"
"\t\tmessage(\"foo\");\n"
"\t}\n"
"}\n"
"\n"
"public class Child extends Parent\n"
"{\n"
"\tvoid foo()\n"
"\t{\n"
"\t\tmessage(\"bar\");\n"
"\t}\n"
"\tvoid bar()\n"
"\t{\n"
"\t\tmessage(\"foo bar\");\n"
"\t}\n"
"}\n"
"\n"
"extern void object::Test()\n"
"{\n"
"\tParent people[2];\n"
"\tpeople[0] = new Parent();\n"
"\tpeople[1] = new Child();\n"
"\tfor (int i = 0; i < 2; ++i)\n"
"\t{\n"
"\t\tpeople[i].foo();\n"
"\t}\n"
"\t//people[1].bar(); // Error\n"
"\tChild child = people[1];\n"
"\tchild.bar(); // OK\n"
"}"
msgstr ""
#. type: \b; header
#: ../E/extends.txt:102
#, no-wrap
msgid "Multiple Inheritance"
msgstr ""
#. type: Plain text
#: ../E/extends.txt:103
#, no-wrap
msgid "A child cannot have multiple parents, however, a parent can have many children."
msgstr ""
#. type: Plain text
#: ../E/extends.txt:106
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|public>public</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|protected>protected</a></code>, <code><a cbot|new>new</a></code>, <code><a cbot|pointer>reference</a></code>, <code><a cbot|this>this</a></code>, <code><a cbot|super>super</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: Plain text
#: ../E/super.txt:2
#, no-wrap
msgid "This keyword is similar to <code><a cbot|this>this</a></code>, however, it grants access to methods from the parent class (see the <code><a cbot|extends>extends</a></code> keyword), which is especially useful for method overriding."
msgstr ""
#. type: Source code
#: ../E/super.txt:6
#, no-wrap
msgid ""
"public class Parent\n"
"{\n"
"\tprotected int field;\n"
"\t\n"
"\tvoid Parent()\n"
"\t{\n"
"\t\tfield = 0;\n"
"\t}\n"
"\t\n"
"\tvoid Print()\n"
"\t{\n"
"\t\tmessage(\"Parent's field: \" + field);\n"
"\t}\n"
"}\n"
"\n"
"public class Child extends Parent\n"
"{\n"
"\tprivate int childsField;\n"
"\t\n"
"\tvoid Child()\n"
"\t{\n"
"\t\tsuper.Parent();\n"
"\t\tchildsField = field + 1;\n"
"\t}\n"
"\t\n"
"\tvoid Print()\n"
"\t{\n"
"\t\tsuper.Print();\n"
"\t\tmessage(\"Child's field: \" + childsField);\n"
"\t}\n"
"}\n"
"\n"
"extern void object::Test()\n"
"{\n"
"\tChild child();\n"
"\tchild.Print(); // Will show both 0 and 1\n"
"}"
msgstr ""
#. type: Plain text
#: ../E/extends.txt:2
#, no-wrap
msgid "This keyword is used in a <code><a cbot|class>class</a></code> definition when we want the class to inherit members from another class. The class which is extended we usually call a parent or base, the extending class we call a child."
msgstr ""
#. type: Source code
#: ../E/extends.txt:6
#, no-wrap
msgid ""
"public class Parent\n"
"{\n"
"\tvoid foo()\n"
"\t{\n"
"\t\tmessage(\"foo\");\n"
"\t}\n"
"}\n"
"\n"
"public class Child extends Parent\n"
"{\n"
"\tvoid bar()\n"
"\t{\n"
"\t\tmessage(\"bar\");\n"
"\t}\n"
"}\n"
"\n"
"extern void object::Test()\n"
"{\n"
"\tChild child();\n"
"\tchild.foo(); // Will show \"foo\"\n"
"\tchild.bar(); // Will show \"bar\"\n"
"}"
msgstr ""
#. type: Plain text
#: ../E/extends.txt:60
#, no-wrap
msgid "A parent's method can be called inside an overriden method by using the <code><a cbot|super>super</a></code> keyword."
msgstr ""
#. type: Plain text
#: ../E/class.txt:56
#, no-wrap
msgid "As shown in the previous example, the class members can be initialized in the class definition (<c/>int x = 3.33;<n/>)."
msgstr ""
#. type: Plain text
#: ../E/open.txt:13
#, no-wrap
msgid ""
"<code>\"r\"</code> mode: open for reading.\n"
"<code>\"w\"</code> mode: open for writing.\n"
"<code>\"a\"</code> mode: open for appending."
msgstr ""
#. type: Plain text
#: ../E/openfile.txt:2
#, no-wrap
msgid "<c/>openfile();<n/> opens an text file in the files/ folder. This is not a method of the <code><a cbot|file>file</a></code> class but openfile returns a <a cbot|pointer>reference</a> to a new instance of the file class. You must supply two parameters, the filename and the opening mode."
msgstr ""
#. type: Plain text
#: ../E/openfile.txt:6
#, no-wrap
msgid ""
"<code>\"r\"</code> mode: open for reading.\n"
"<code>\"w\"</code> mode: open for writing.\n"
"<code>\"w\"</code> mode: open for appending."
msgstr ""

View File

@ -53,13 +53,13 @@ msgid "Time in seconds."
msgstr "Czas w sekundach."
#. type: \t; header
#: ../E/abstime.txt:10 ../E/acos.txt:11 ../E/aim.txt:23 ../E/array.txt:41 ../E/asin.txt:11 ../E/atan.txt:11 ../E/atan2.txt:16 ../E/bloc.txt:48 ../E/bool.txt:4 ../E/break.txt:24 ../E/build.txt:27 ../E/buildingenabled.txt:22 ../E/busy.txt:14 ../E/canbuild.txt:22 ../E/canresearch.txt:14 ../E/category.txt:109 ../E/ceil.txt:12 ../E/class.txt:70 ../E/close.txt:6 ../E/cond.txt:4 ../E/continue.txt:24 ../E/cos.txt:11 ../E/deletef.txt:9 ../E/delinfo.txt:13 ../E/destroy.txt:15 ../E/detect.txt:27 ../E/direct.txt:13 ../E/dist.txt:29 ../E/dist2d.txt:13 ../E/do.txt:27 ../E/drop.txt:28 ../E/eof.txt:13 ../E/errmode.txt:32 ../E/expr.txt:197 ../E/extern.txt:29 ../E/factory.txt:21 ../E/false.txt:4 ../E/file.txt:16 ../E/fire.txt:30 ../E/flatgrnd.txt:16 ../E/flatspace.txt:25 ../E/float.txt:24 ../E/floor.txt:12 ../E/for.txt:51 ../E/function.txt:129 ../E/goto.txt:34 ../E/grab.txt:28 ../E/if.txt:39 ../E/int.txt:18 ../E/jet.txt:14 ../E/message.txt:24 ../E/motor.txt:38 ../E/move.txt:21 ../E/nan.txt:14 ../E/new.txt:20 ../E/null.txt:4 ../E/object.txt:79 ../E/open.txt:18 ../E/openfile.txt:10 ../E/pencolor.txt:14 ../E/pendown.txt:17 ../E/penup.txt:11 ../E/penwidth.txt:14 ../E/point.txt:35 ../E/pointer.txt:51 ../E/pow.txt:14 ../E/private.txt:17 ../E/produce.txt:30 ../E/public.txt:49 ../E/radar.txt:80 ../E/radarall.txt:19 ../E/rand.txt:8 ../E/readln.txt:18 ../E/receive.txt:16 ../E/recycle.txt:12 ../E/research.txt:18 ../E/researched.txt:14 ../E/researches.txt:27 ../E/retobj.txt:13 ../E/return.txt:29 ../E/round.txt:12 ../E/search.txt:25 ../E/send.txt:17 ../E/shield.txt:18 ../E/sin.txt:11 ../E/sizeof.txt:21 ../E/sniff.txt:16 ../E/space.txt:22 ../E/sqrt.txt:11 ../E/static.txt:20 ../E/strfind.txt:18 ../E/string.txt:32 ../E/strleft.txt:14 ../E/strlen.txt:12 ../E/strlower.txt:10 ../E/strmid.txt:18 ../E/strright.txt:14 ../E/strupper.txt:10 ../E/strval.txt:17 ../E/switch.txt:70 ../E/synchro.txt:23 ../E/takeoff.txt:15 ../E/tan.txt:11 ../E/term.txt:30 ../E/testinfo.txt:16 ../E/this.txt:52 ../E/thump.txt:12 ../E/topo.txt:13 ../E/true.txt:4 ../E/trunc.txt:12 ../E/turn.txt:32 ../E/type.txt:32 ../E/var.txt:66 ../E/void.txt:10 ../E/wait.txt:21 ../E/while.txt:46 ../E/writeln.txt:19
#: ../E/abstime.txt:10 ../E/acos.txt:11 ../E/aim.txt:23 ../E/array.txt:41 ../E/asin.txt:11 ../E/atan.txt:11 ../E/atan2.txt:16 ../E/bloc.txt:48 ../E/bool.txt:4 ../E/break.txt:24 ../E/build.txt:27 ../E/buildingenabled.txt:22 ../E/busy.txt:14 ../E/canbuild.txt:22 ../E/canresearch.txt:14 ../E/category.txt:109 ../E/ceil.txt:12 ../E/class.txt:120 ../E/close.txt:6 ../E/cond.txt:4 ../E/continue.txt:24 ../E/cos.txt:11 ../E/deletef.txt:9 ../E/delinfo.txt:13 ../E/destroy.txt:15 ../E/detect.txt:27 ../E/direct.txt:13 ../E/dist.txt:29 ../E/dist2d.txt:13 ../E/do.txt:27 ../E/drop.txt:28 ../E/eof.txt:13 ../E/errmode.txt:32 ../E/expr.txt:197 ../E/extends.txt:105 ../E/extern.txt:29 ../E/factory.txt:21 ../E/false.txt:4 ../E/file.txt:16 ../E/fire.txt:30 ../E/flatgrnd.txt:16 ../E/flatspace.txt:25 ../E/float.txt:24 ../E/floor.txt:12 ../E/for.txt:51 ../E/function.txt:129 ../E/goto.txt:34 ../E/grab.txt:28 ../E/if.txt:39 ../E/int.txt:18 ../E/jet.txt:14 ../E/message.txt:24 ../E/motor.txt:38 ../E/move.txt:21 ../E/nan.txt:14 ../E/new.txt:20 ../E/null.txt:4 ../E/object.txt:79 ../E/open.txt:19 ../E/openfile.txt:11 ../E/pencolor.txt:14 ../E/pendown.txt:17 ../E/penup.txt:11 ../E/penwidth.txt:14 ../E/point.txt:35 ../E/pointer.txt:51 ../E/pow.txt:14 ../E/private.txt:19 ../E/produce.txt:30 ../E/protected.txt:26 ../E/public.txt:49 ../E/radar.txt:80 ../E/radarall.txt:19 ../E/rand.txt:8 ../E/readln.txt:18 ../E/receive.txt:16 ../E/recycle.txt:12 ../E/research.txt:18 ../E/researched.txt:14 ../E/researches.txt:27 ../E/retobj.txt:13 ../E/return.txt:29 ../E/round.txt:12 ../E/search.txt:25 ../E/send.txt:17 ../E/shield.txt:18 ../E/sin.txt:11 ../E/sizeof.txt:21 ../E/sniff.txt:16 ../E/space.txt:22 ../E/sqrt.txt:11 ../E/static.txt:20 ../E/strfind.txt:18 ../E/string.txt:32 ../E/strleft.txt:14 ../E/strlen.txt:12 ../E/strlower.txt:10 ../E/strmid.txt:18 ../E/strright.txt:14 ../E/strupper.txt:10 ../E/strval.txt:17 ../E/super.txt:45 ../E/switch.txt:70 ../E/synchro.txt:23 ../E/takeoff.txt:15 ../E/tan.txt:11 ../E/term.txt:30 ../E/testinfo.txt:16 ../E/this.txt:52 ../E/thump.txt:12 ../E/topo.txt:13 ../E/true.txt:4 ../E/trunc.txt:12 ../E/turn.txt:32 ../E/type.txt:32 ../E/var.txt:66 ../E/void.txt:10 ../E/wait.txt:21 ../E/while.txt:46 ../E/writeln.txt:19
#, no-wrap
msgid "See also"
msgstr "Zobacz również"
#. type: Plain text
#: ../E/abstime.txt:11 ../E/aim.txt:24 ../E/array.txt:42 ../E/bool.txt:5 ../E/break.txt:25 ../E/busy.txt:15 ../E/cond.txt:5 ../E/continue.txt:25 ../E/deletef.txt:10 ../E/destroy.txt:16 ../E/detect.txt:28 ../E/direct.txt:14 ../E/dist.txt:30 ../E/dist2d.txt:14 ../E/drop.txt:29 ../E/errmode.txt:33 ../E/expr.txt:198 ../E/extern.txt:30 ../E/false.txt:5 ../E/fire.txt:31 ../E/flatgrnd.txt:17 ../E/flatspace.txt:26 ../E/float.txt:25 ../E/for.txt:52 ../E/function.txt:130 ../E/goto.txt:35 ../E/grab.txt:29 ../E/if.txt:40 ../E/int.txt:19 ../E/jet.txt:15 ../E/message.txt:25 ../E/move.txt:22 ../E/nan.txt:15 ../E/object.txt:80 ../E/openfile.txt:11 ../E/pencolor.txt:15 ../E/pendown.txt:18 ../E/penup.txt:12 ../E/penwidth.txt:15 ../E/point.txt:36 ../E/produce.txt:31 ../E/recycle.txt:13 ../E/retobj.txt:14 ../E/return.txt:30 ../E/search.txt:26 ../E/shield.txt:19 ../E/sizeof.txt:22 ../E/sniff.txt:17 ../E/space.txt:23 ../E/string.txt:33 ../E/switch.txt:71 ../E/takeoff.txt:16 ../E/term.txt:31 ../E/thump.txt:13 ../E/topo.txt:14 ../E/true.txt:5 ../E/turn.txt:33 ../E/type.txt:33 ../E/var.txt:67 ../E/void.txt:11 ../E/wait.txt:22
#: ../E/abstime.txt:11 ../E/aim.txt:24 ../E/array.txt:42 ../E/bool.txt:5 ../E/break.txt:25 ../E/busy.txt:15 ../E/cond.txt:5 ../E/continue.txt:25 ../E/deletef.txt:10 ../E/destroy.txt:16 ../E/detect.txt:28 ../E/direct.txt:14 ../E/dist.txt:30 ../E/dist2d.txt:14 ../E/drop.txt:29 ../E/errmode.txt:33 ../E/expr.txt:198 ../E/extern.txt:30 ../E/false.txt:5 ../E/fire.txt:31 ../E/flatgrnd.txt:17 ../E/flatspace.txt:26 ../E/float.txt:25 ../E/for.txt:52 ../E/function.txt:130 ../E/goto.txt:35 ../E/grab.txt:29 ../E/if.txt:40 ../E/int.txt:19 ../E/jet.txt:15 ../E/message.txt:25 ../E/move.txt:22 ../E/nan.txt:15 ../E/object.txt:80 ../E/openfile.txt:12 ../E/pencolor.txt:15 ../E/pendown.txt:18 ../E/penup.txt:12 ../E/penwidth.txt:15 ../E/point.txt:36 ../E/produce.txt:31 ../E/recycle.txt:13 ../E/retobj.txt:14 ../E/return.txt:30 ../E/search.txt:26 ../E/shield.txt:19 ../E/sizeof.txt:22 ../E/sniff.txt:17 ../E/space.txt:23 ../E/string.txt:33 ../E/switch.txt:71 ../E/takeoff.txt:16 ../E/term.txt:31 ../E/thump.txt:13 ../E/topo.txt:14 ../E/true.txt:5 ../E/turn.txt:33 ../E/type.txt:33 ../E/var.txt:67 ../E/void.txt:11 ../E/wait.txt:22
#, no-wrap
msgid "<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr "<a cbot>Programowanie</a>, <a cbot|type>typy</a> i <a cbot|category>kategorie</a>."
@ -580,12 +580,6 @@ msgstr "<a cbot>Język CBOT</a> i <a cbot|type>zmienne</a>."
msgid "Instruction <code>class</code>"
msgstr "Instrukcja <code>class</code>"
#. type: Plain text
#: ../E/class.txt:2
#, no-wrap
msgid "This allows you to declare a class definition using following syntax:"
msgstr "Pozwala na zadeklarowanie definicji klasy, przy użyciu następującej składni:"
#. type: Source code
#: ../E/class.txt:4
#, no-wrap
@ -600,164 +594,6 @@ msgstr ""
"\tdeklaracje;\n"
"}"
#. type: Plain text
#: ../E/class.txt:9
#, no-wrap
msgid "Classes can only be <a cbot|public>public</a>, that is they can be used from all bots in a mission. Class members are also public, that is they are accessible from outside the class. Class members can be fields or functions (also called methods), for example the followin class <code>MyClass</code> contains 4 fields (a, b, x and s) and one method (MyFunction)."
msgstr "Klasy mogą być tylko typu <a cbot|public>public</a> (publiczne), a więc mogą być używane podczas misji przez wszystkie roboty. Elementy klasy również są publiczne, dostępne spoza klasy. Do klasy mogą należeć pola lub funkcje (zwane również metodami), na przykład następująca klasa <code>MojaKlasa</code> zawiera 4 pola (a, b, x oraz s) i jedną metodę (MojaFunkcja)."
#. type: Source code
#: ../E/class.txt:11
#, no-wrap
msgid ""
"public class MyClass\n"
"{\n"
"\tint a, b;\n"
"\tfloat x = 3.33;\n"
"\tstring s = \"hello\";\n"
"\tfloat MyFunction( float value )\n"
"\t{\n"
"\t\treturn (value*x)-1;\n"
"\t}\n"
"}"
msgstr ""
"public class MojaKlasa\n"
"{\n"
"\tint a, b;\n"
"\tfloat x = 3.33;\n"
"\tstring s = \"Cześć\";\n"
"\tfloat MojaFunkcja( float value )\n"
"\t{\n"
"\t\treturn (value*x)-1;\n"
"\t}\n"
"}"
#. type: Plain text
#: ../E/class.txt:22
#, no-wrap
msgid "As shown in this exemple the class members can be initialized (<code>x=3.33</code>). You can also define a constructor which is a special method having the same name as the class name. This method will be called automatically at creation time of a class instance. You can also declare more than one method with the same name but different parameters."
msgstr "Jak pokazano na tym przykładzie, elementy klasy mogą być inicjalizowane (<code>x=3.33</code>). Można też zdefiniować konstruktor, który jest specjalną metodą o nazwie takiej samej jak nazwa klasy. Metoda ta jest wywoływana automatycznie podczas tworzenia instancji klasy. Możliwe jest również zadeklarowanie więcej niż jednej metody o tej samej nazwie ale o innych parametrach."
#. type: Source code
#: ../E/class.txt:24
#, no-wrap
msgid ""
"public class MyClass\n"
"{\n"
"\tint a, b;\n"
"\tvoid MyClass( )\n"
"\t{\n"
"\t\ta = 2; b = 3;\n"
"\t}\n"
"\tvoid MyClass( int a, int b )\n"
"\t{\n"
"\t\tthis.a = a; this.b = b;\n"
"\t}\n"
"}"
msgstr ""
"public class MojaKlasa\n"
"{\n"
"\tint a, b;\n"
"\tvoid MojaKlasa( )\n"
"\t{\n"
"\t\ta = 2; b = 3;\n"
"\t}\n"
"\tvoid MojaKlasa( int a, int b )\n"
"\t{\n"
"\t\tthis.a = a; this.b = b;\n"
"\t}\n"
"}"
#. type: Plain text
#: ../E/class.txt:37
#, no-wrap
msgid "In this example two constructors are declared for <code>MyClass</code>, one without parameters and the other one with two parameters. As the names of the parameters of the second constructor are the same as the names of the two members <code>a</code> et <code>b</code> we must use the <code><a cbot|this>this</a>.a</code> and <code><a cbot|this>this</a>.b</code> to avoid confusion with the parameters. Another more simpler solution would be to give different names to the parameters."
msgstr "W tym przykładzie zadeklarowano dwa konstruktory dla klasy <code>MojaKlasa</code>, jeden bez parametrów, drugi z dwoma parametrami. Jako że nazwy parametrów drugiego konstruktora są takie same jak nazwy dwóch pól klasy <code>a</code> et <code>b</code> konieczne jest użycie <code><a cbot|this>this</a>.a</code> i <code><a cbot|this>this</a>.b</code> w celu rozróżnienia parametrów. Inne, prostsze rozwiązanie, to nadanie różnych nazw parametrom."
#. type: Source code
#: ../E/class.txt:39
#, no-wrap
msgid ""
"void Test( )\n"
"{\n"
"\tMyClass item1(); // constr. w/o parameters\n"
"\tMyClass item2(4, 5); // constr. with 2 parameters\n"
"\tMyClass item3; // no constructor called,\n"
" // therefore item3 == null\n"
"}"
msgstr ""
"void Test( )\n"
"{\n"
"\tMojaKlasa element1(); // konstruktor bez parametrów\n"
"\tMojaKlasa element2(4, 5); // konstruktor z 2 parametrami\n"
"\tMojaKlasa element3; // konstruktor nie jest wywoływany,\n"
" // więc item3 == null\n"
"}"
#. type: Plain text
#: ../E/class.txt:47
#, no-wrap
msgid "You can also define a destructor. This must be a <code>void</code> fonction without parameters that has the same name as the class name but prefixed by the ~ character. The destructor is called automatically as soon as the class instance is no more referenced by anyone."
msgstr "Można też zdefinować destruktor. Musi to być funkcja <code>void</code> bez parametrów o takiej samej nazwie jak nazwa klasy, poprzedzona znakiem ~. Destruktor jest wywoływany automatycznie gdy nie ma już żadnych odwołań do instancji klasy."
#. type: Source code
#: ../E/class.txt:49
#, no-wrap
msgid ""
"public class MyClass\n"
"{\n"
"\tstatic private int counter = 0; // instance counter\n"
"\tvoid MyClass( )\n"
"\t{\n"
"\t\tcounter ++; // one instance more\n"
"\t}\n"
"\tvoid ~MyClass( )\n"
"\t{\n"
"\t\tcounter --; // one instance less\n"
"\t}\n"
"}\n"
"void Test()\n"
"{\n"
"\tMyClass item1( ); // counter = 1\n"
"\tMyClass item2( ); // counter = 2\n"
"\titem1 = null; // counter = 1\n"
"} // counter = 0"
msgstr ""
"public class MojaKlasa\n"
"{\n"
"\tstatic private int licznik = 0; // licznik instancji\n"
"\tvoid MojaKlasa( )\n"
"\t{\n"
"\t\tlicznik ++; // jedna instancja więcej\n"
"\t}\n"
"\tvoid ~MojaKlasa( )\n"
"\t{\n"
"\t\tlicznik --; // jedna instancja mniej\n"
"\t}\n"
"}\n"
"void Test()\n"
"{\n"
"\tMojaKlasa element1( ); // licznik = 1\n"
"\tMojaKlasa element2( ); // licznik = 2\n"
"\telement1 = null; // licznik = 1\n"
"} // licznik = 0"
#. type: Plain text
#: ../E/class.txt:68
#, no-wrap
msgid "If you pass a class instance as parameter to a <a cbot|function>function</a>, the function only receives a <a cbot|pointer>reference</a> to the instance. That means if you modify the instance in the function, the instance that has been passed to the function will be actuallay modified."
msgstr "W przypadku przekazywania instancji klasy jako parametru <a cbot|function>funkcji</a>, otrzymuje ona tylko <a cbot|pointer>wskaźnik</a> do instancji. Oznacza to, że jeśli zostanie zmodyfikowana instancja wewnątrz funkcji, w rzeczywistości zostanie zmodyfikowana instancja przekazana funkcji."
#. type: Plain text
#: ../E/class.txt:71
#, no-wrap
msgid ""
"<code><a cbot|public>public</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|static>static</a></code>, <code><a cbot|synchro>synchronized</a></code>, <code><a cbot|new>new</a></code>, <code><a cbot|pointer>reference</a></code>, <code><a cbot|this>this</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
"<code><a cbot|public>public</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|static>static</a></code>, <code><a cbot|synchro>synchronized</a></code>, <code><a cbot|new>new</a></code>, <code><a cbot|pointer>wskaźnik</a></code>, <code><a cbot|this>this</a></code>\n"
"<a cbot>Programowanie</a>, <a cbot|type>typy</a> i <a cbot|category>kategorie</a>."
#. type: \b; header
#: ../E/close.txt:1
#, no-wrap
@ -2823,23 +2659,13 @@ msgstr ""
"\thandle.close();"
#. type: Plain text
#: ../E/open.txt:13 ../E/openfile.txt:6
#, no-wrap
msgid ""
"<code>\"r\"</code> mode: open for reading.\n"
"<code>\"w\"</code> mode: open for writing."
msgstr ""
"<code>\"r\"</code> tryb: otwarty do odczytu.\n"
"<code>\"w\"</code> tryb: otwarty do zapisu."
#. type: Plain text
#: ../E/open.txt:16
#: ../E/open.txt:17
#, no-wrap
msgid "Files can only be created and opened in the files/ folder which is located in the folder where Colobot has been installed. You cannot not create or open files that are located elsewhere than in the files/ folder."
msgstr "Pliki mogą być tworzone tylko w folderze files/ znajdującym się w folderze, w którym została zainstalowana gra Colobot. Nie jest możliwe tworzenie ani otwieranie plików znajdujących się w innych folderach."
#. type: Plain text
#: ../E/open.txt:19
#: ../E/open.txt:20
#, no-wrap
msgid ""
"<code><a cbot|file>file</a></code>, <code><a cbot|close>close</a></code>, <code><a cbot|readln>readln</a></code>, <code><a cbot|writeln>writeln</a></code> and <code><a cbot|eof>eof</a></code>.\n"
@ -2854,12 +2680,6 @@ msgstr ""
msgid "Instruction <code>openfile</code>"
msgstr "Instrukcja <code>openfile</code>"
#. type: Plain text
#: ../E/openfile.txt:2
#, no-wrap
msgid "<c/>openfile();<n/> opens an text file in the files/ folder. This is not a method of the <code><a cbot|file>file</a></code> class but openfile returne a <a cbot|pointer>reference</a> to a new instance of the file class. You must supply two parameters, the filename and the opening mode."
msgstr "Instrukcja <c/>openfile();<n/> otwiera plik tekstowy w folderze files/. Nie jest to metoda klasy <code><a cbot|file>file</a></code> ale zwraca ona <a cbot|pointer>wskaźnik</a> do nowej instancji klasy file. Należy określić dwa parametry, nazwę pliku i tryb otwarcia."
#. type: Source code
#: ../E/openfile.txt:4
#, no-wrap
@ -3144,14 +2964,8 @@ msgstr ""
msgid "Instruction <code>private</code> (for specialists)"
msgstr "Instrukcja <code>private</code> (dla specjalistów)"
#. type: Plain text
#: ../E/private.txt:2
#, no-wrap
msgid "<a cbot|class>Class</a> members can be <a cbot|public>public</a> (by default) or private. A member can be declared private by putting <code>private</code> before the type declaration of the member. Private members are not accessible from outside the class definition."
msgstr "Elementy <a cbot|class>klasy</a> mogą być <a cbot|public>publiczne</a> (domyślnie) lub prywatne. Aby zadeklarować element jako prywatny, należy umieścić instrukcję <code>private</code> przed deklaracją jego typu. Elementy prywatne nie są widoczne poza definicją klasy."
#. type: Source code
#: ../E/private.txt:4
#: ../E/private.txt:6
#, no-wrap
msgid ""
"public class MyClass\n"
@ -3180,16 +2994,6 @@ msgstr ""
"\tmessage( item.position ); // powoduje błąd\n"
"}"
#. type: Plain text
#: ../E/private.txt:18
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|public>public</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
"<code><a cbot|class>class</a></code>, <code><a cbot|public>public</a></code>\n"
"<a cbot>Programowanie</a>, <a cbot|type>typy</a> i <a cbot|category>kategorie</a>."
#. type: \b; header
#: ../E/public.txt:1
#, no-wrap
@ -3294,12 +3098,6 @@ msgstr "Jeśli robot zawierający funkcję zadeklarowaną jako <code>public</cod
msgid "Instruction <code>public</code> for classes"
msgstr "Instrukcja <code>public</code> dla klas"
#. type: Plain text
#: ../E/public.txt:34
#, no-wrap
msgid "<a cbot|class>Class</a> members can be public (by default) or <a cbot|private>privat</a>. A member can be declared private by putting <code>private</code> before the member type. Private members are not accessible from outside the class definition."
msgstr "Elementy <a cbot|class>klasy</a> mogą być publiczne (domyślnie) lub <a cbot|private>prywatne</a>. Aby zadeklarować element jako prywatny, należy umieścić instrukcję <code>private</code> przed deklaracją jego typu. Elementy prywatne nie są dostępne poza definicją klasy."
#. type: Source code
#: ../E/public.txt:36
#, no-wrap
@ -3330,16 +3128,6 @@ msgstr ""
"\tmessage( item.position ); // powoduje błąd\n"
"}"
#. type: Plain text
#: ../E/public.txt:50
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|function>functions</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
"<code><a cbot|class>class</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|function>funkcje</a></code>\n"
"<a cbot>Programowanie</a>, <a cbot|type>typy</a> i <a cbot|category>kategorie</a>."
#. type: \b; header
#: ../E/radar.txt:1
#, no-wrap
@ -4922,16 +4710,6 @@ msgstr ""
"\t}\n"
"}"
#. type: Plain text
#: ../E/this.txt:53
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
"<code><a cbot|class>class</a></code>\n"
"<a cbot>Programowanie</a>, <a cbot|type>typy</a> i <a cbot|category>kategorie</a>."
#. type: \b; header
#: ../E/thump.txt:1
#, no-wrap
@ -8206,7 +7984,7 @@ msgid "Firstly, the condition is valued and then the first result is returned if
msgstr ""
#. type: \t; header
#: ../E/expr.txt:157
#: ../E/expr.txt:157 ../E/extends.txt:4 ../E/extends.txt:65 ../E/private.txt:4 ../E/protected.txt:4 ../E/super.txt:4
#, no-wrap
msgid "Example"
msgstr ""
@ -8472,3 +8250,600 @@ msgid ""
" <code><a object|target1>Target1</a> </code>Flying target\n"
" <code><a object|nest>AlienNest</a> </code>Alien Nest"
msgstr ""
#. type: Plain text
#: ../E/class.txt:10
#, no-wrap
msgid "Classes can be only <a cbot|public>public</a>. This means that they can be used by all bots in a mission."
msgstr ""
#. type: \b; header
#: ../E/class.txt:12
#, no-wrap
msgid "Class Members"
msgstr ""
#. type: Plain text
#: ../E/class.txt:13
#, no-wrap
msgid "Class members are fields (<a cbot|var>variables</a>) and methods (<a cbot|function>functions</a>)."
msgstr ""
#. type: Plain text
#: ../E/class.txt:15
#, no-wrap
msgid "For example, the following class dubbed <code>MyClass</code> contains 4 fields (<code>a</code>, <code>b</code>, <code>x</code> and <code>s</code>) and one method (<code>MyFunction</code>)."
msgstr ""
#. type: Source code
#: ../E/class.txt:17
#, no-wrap
msgid ""
"public class MyClass\n"
"{\n"
"\tint a, b;\n"
"\tfloat x = 3.33;\n"
"\tstring s = \"hello\";\n"
"\tfloat MyFunction(float value)\n"
"\t{\n"
"\t\treturn (value * x) - 1;\n"
"\t}\n"
"}"
msgstr ""
#. type: \t; header
#: ../E/class.txt:55
#, no-wrap
msgid "Member Initialization"
msgstr ""
#. type: Plain text
#: ../E/class.txt:60
#, no-wrap
msgid "Example:<c/>"
msgstr ""
#. type: Source code
#: ../E/class.txt:61
#, no-wrap
msgid ""
"public class MyClass\n"
"{\n"
"\tint a, b;\n"
"\tvoid MyClass()\n"
"\t{\n"
"\t\ta = 2; b = 3;\n"
"\t}\n"
"\tvoid MyClass(int a, int b)\n"
"\t{\n"
"\t\tthis.a = a; this.b = b;\n"
"\t}\n"
"}"
msgstr ""
#. type: Plain text
#: ../E/class.txt:76
#, no-wrap
msgid "As the names of the parameters of the second constructor are the same as the names of the two members <code>a</code> and <code>b</code>, we must use the <code><a cbot|this>this</a></code> <a cbot|pointer>reference</a> to avoid confusion with the parameters' names."
msgstr ""
#. type: \b; header
#: ../E/class.txt:78
#, no-wrap
msgid "Object Creation"
msgstr ""
#. type: Plain text
#: ../E/class.txt:79
#, no-wrap
msgid "You can create objects of type <code>YourClass</code> using the <code><a cbot|new>new</a></code> keyword. Example:"
msgstr ""
#. type: \b; header
#: ../E/class.txt:90
#, no-wrap
msgid "Object Destruction"
msgstr ""
#. type: \b; header
#: ../E/class.txt:114
#, no-wrap
msgid "Passing Objects to Functions"
msgstr ""
#. type: Plain text
#: ../E/class.txt:115
#, no-wrap
msgid "Objects in CBOT are passed by <a cbot|pointer>reference</a>. This means that when an object is passed to a <a cbot|function>function</a>, the function receives a copy of a pointer to the instance, not a copy of the object, so any modifications on the object will be visible outside of the function."
msgstr ""
#. type: \b; header
#: ../E/class.txt:117
#, no-wrap
msgid "Inheritance"
msgstr ""
#. type: Plain text
#: ../E/class.txt:118
#, no-wrap
msgid "A class can inherit public and protected members of another class by using the <code><a cbot|extends>extends</a></code> keyword."
msgstr ""
#. type: Plain text
#: ../E/class.txt:2
#, no-wrap
msgid "This keyword allows you to create a class definition by using the following syntax:"
msgstr ""
#. type: \t; header
#: ../E/class.txt:9
#, no-wrap
msgid "All Classes Are Public"
msgstr ""
#. type: \t; header
#: ../E/class.txt:52
#, no-wrap
msgid "Class Members Modifiers"
msgstr ""
#. type: \t; header
#: ../E/class.txt:75
#, no-wrap
msgid "Using <code><a cbot|this>this</a></code>"
msgstr ""
#. type: Source code
#: ../E/class.txt:81
#, no-wrap
msgid ""
"extern void object::Test()\n"
"{\n"
"\tMyClass object1(); // Call default constructor (without parameters)\n"
"\tMyClass object2(4, 5); // Call constructor with two int parameters\n"
"\tMyClass object3; // No constructor called, object3 == null\n"
"\tobject3 = new MyClass(); // We call constructor now, object3 != null\n"
"}"
msgstr ""
#. type: Plain text
#: ../E/class.txt:91
#, no-wrap
msgid "You can also define a destructor. This must be a <code><a cbot|void>void</a></code> fonction without parameters, which has the same name as the class but prefixed with the <code>~</code> character. The destructor is called automatically as soon as the class instance is no more referenced by anyone. Example:"
msgstr ""
#. type: Source code
#: ../E/class.txt:93
#, no-wrap
msgid ""
"public class MyClass\n"
"{\n"
"\tstatic private int counter = 0; // instance counter\n"
"\tvoid MyClass( )\n"
"\t{\n"
"\t\tcounter++; // one instance more\n"
"\t}\n"
"\tvoid ~MyClass( )\n"
"\t{\n"
"\t\tcounter--; // one instance less\n"
"\t}\n"
"}\n"
"extern void object::Test()\n"
"{\n"
"\t // counter == 0\n"
"\tMyClass item1( ); // counter == 1\n"
"\tMyClass item2( ); // counter == 2\n"
"\titem1 = null; // counter == 1\n"
"}\n"
"// counter == 0"
msgstr ""
#. type: \b; header
#: ../E/class.txt:28
#, no-wrap
msgid "Accessing Class Members"
msgstr ""
#. type: Plain text
#: ../E/class.txt:29
#, no-wrap
msgid "Class members can be accessed outside of the class definition by using the <code>.</code> operator. Example:"
msgstr ""
#. type: Plain text
#: ../E/class.txt:50
#, no-wrap
msgid "Class members are <a cbot|public>public</a> by default, which means that they are accessible outside of the class definition. They can also be declared as <code><a cbot|private>private</a></code> or <code><a cbot|protected>protected</a></code>. Such members can only be accessed inside of the class definition."
msgstr ""
#. type: Plain text
#: ../E/class.txt:53
#, no-wrap
msgid "Fields and methods can also be declared as <code><a cbot|static>static</a></code>. Methods can be additionaly declared as <code><a cbot|synchro>synchronized</a></code>."
msgstr ""
#. type: Plain text
#: ../E/class.txt:58
#, no-wrap
msgid "Another way of initiliazing fields is by defining a constructor which is a special method having the same name as the class. This method will be called automatically at <a cbot|new>creation</a> time of a class instance. Constructors can be <a cbot|function>overloaded</a>."
msgstr ""
#. type: Source code
#: ../E/class.txt:31
#, no-wrap
msgid ""
"public class MyClass\n"
"{\n"
"\tint myField = 0;\n"
"\tint MyFunction()\n"
"\t{\n"
"\t\treturn myField * 2;\n"
"\t}\n"
"}\n"
"\n"
"extern void object::Test()\n"
"{\n"
"\tMyClass myObject();\n"
"\tmyObject.myField = 10;\n"
"\tmessage(myObject.MyFunction()); // 20\n"
"\tMyClass mySecondObject();\n"
"\tmySecondObject.myField = myObject.myField - 2;\n"
"\tmessage(mySecondObject.MyFunction()); // 16\n"
"}"
msgstr ""
#. type: Plain text
#: ../E/class.txt:121
#, no-wrap
msgid ""
"<code><a cbot|public>public</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|protected>protected</a></code>, <code><a cbot|static>static</a></code>, <code><a cbot|synchro>synchronized</a></code>, <code><a cbot|new>new</a></code>, <code><a cbot|pointer>reference</a></code>, <code><a cbot|this>this</a></code>, <code><a cbot|super>super</a></code>, <code><a cbot|extends>extends</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: \b; header
#: ../E/protected.txt:1
#, no-wrap
msgid "Keyword <code>protected</code>"
msgstr ""
#. type: Plain text
#: ../E/protected.txt:2
#, no-wrap
msgid "This is an access modifier for <a cbot|class>class</a> members. Protected class members can be accessed in a child class, but they can't be accessed outside of classes definitions being part of the same inheritance tree (see the <code><a cbot|extends>extends</a></code> keyword)."
msgstr ""
#. type: Source code
#: ../E/protected.txt:6
#, no-wrap
msgid ""
"public class Parent\n"
"{\n"
"\tprotected int field = 0;\n"
"}\n"
"\n"
"public class Child extends Parent\n"
"{\n"
"\tvoid Print()\n"
"\t{\n"
"\t\tmessage(field);\n"
"\t}\n"
"}\n"
"\n"
"extern void object::Test()\n"
"{\n"
"\tChild child();\n"
"\tchild.Print(); // 0\n"
"\t//child.field = 1; // Error!\n"
"}"
msgstr ""
#. type: Plain text
#: ../E/private.txt:2
#, no-wrap
msgid "This is an access modifier for <a cbot|class>class</a> members. Private members are not accessible outside of the class definition."
msgstr ""
#. type: Plain text
#: ../E/private.txt:20
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|public>public</a></code>, <code><a cbot|protected>protected</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: Plain text
#: ../E/public.txt:34
#, no-wrap
msgid "<code>public</code> is also an access modifier for <a cbot|class>class</a> members, which is the default one. Public members can be accessed from outside of the class definition."
msgstr ""
#. type: Plain text
#: ../E/public.txt:50
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|protected>protected</a></code>, <code><a cbot|function>functions</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: Plain text
#: ../E/protected.txt:27
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|public>public</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|extends>extends</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: \b; header
#: ../E/super.txt:1
#, no-wrap
msgid "Keyword <code>super</code>"
msgstr ""
#. type: Plain text
#: ../E/super.txt:46
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|this>this</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: Plain text
#: ../E/this.txt:53
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|super>super</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: \b; header
#: ../E/extends.txt:1
#, no-wrap
msgid "Keyword <code>extends</code>"
msgstr ""
#. type: \b; header
#: ../E/extends.txt:30
#, no-wrap
msgid "Inherited Members"
msgstr ""
#. type: Plain text
#: ../E/extends.txt:31
#, no-wrap
msgid "Only <code><a cbot|public>public</a></code> and <code><a cbot|protected>protected</a></code> members are inherited. <code><a cbot|private>private</a></code> members are directly inaccessible even for a child, although they can be accessed indirectly through inherited methods."
msgstr ""
#. type: Plain text
#: ../E/extends.txt:33
#, no-wrap
msgid "Constructors and destructors are not inherited, however, they can be overriden."
msgstr ""
#. type: \b; header
#: ../E/extends.txt:35
#, no-wrap
msgid "Method Overriding"
msgstr ""
#. type: Plain text
#: ../E/extends.txt:36
#, no-wrap
msgid "Inherited methods can be overriden (redefined) in the child class definition. Example:"
msgstr ""
#. type: Source code
#: ../E/extends.txt:38
#, no-wrap
msgid ""
"public class Parent\n"
"{\n"
"\tvoid foo()\n"
"\t{\n"
"\t\tmessage(\"foo\");\n"
"\t}\n"
"}\n"
"\n"
"public class Child extends Parent\n"
"{\n"
"\tvoid foo()\n"
"\t{\n"
"\t\tmessage(\"bar\");\n"
"\t}\n"
"}\n"
"\n"
"extern void object::Test()\n"
"{\n"
"\tChild child();\n"
"\tchild.foo(); // Will show \"bar\"\n"
"}"
msgstr ""
#. type: \b; header
#: ../E/extends.txt:62
#, no-wrap
msgid "Polymorphism"
msgstr ""
#. type: Plain text
#: ../E/extends.txt:63
#, no-wrap
msgid "<code><a cbot|pointer>Reference</a></code> of type Parent can point to an object of type Child. However, such a pointer can't be used to access a child member. In order to access a child member, it must be assured that the Parent reference really points to a Child object. If that's the case, it can be safely copied to a pointer of type Child, which has access to the child members."
msgstr ""
#. type: Source code
#: ../E/extends.txt:67
#, no-wrap
msgid ""
"public class Parent\n"
"{\n"
"\tvoid foo()\n"
"\t{\n"
"\t\tmessage(\"foo\");\n"
"\t}\n"
"}\n"
"\n"
"public class Child extends Parent\n"
"{\n"
"\tvoid foo()\n"
"\t{\n"
"\t\tmessage(\"bar\");\n"
"\t}\n"
"\tvoid bar()\n"
"\t{\n"
"\t\tmessage(\"foo bar\");\n"
"\t}\n"
"}\n"
"\n"
"extern void object::Test()\n"
"{\n"
"\tParent people[2];\n"
"\tpeople[0] = new Parent();\n"
"\tpeople[1] = new Child();\n"
"\tfor (int i = 0; i < 2; ++i)\n"
"\t{\n"
"\t\tpeople[i].foo();\n"
"\t}\n"
"\t//people[1].bar(); // Error\n"
"\tChild child = people[1];\n"
"\tchild.bar(); // OK\n"
"}"
msgstr ""
#. type: \b; header
#: ../E/extends.txt:102
#, no-wrap
msgid "Multiple Inheritance"
msgstr ""
#. type: Plain text
#: ../E/extends.txt:103
#, no-wrap
msgid "A child cannot have multiple parents, however, a parent can have many children."
msgstr ""
#. type: Plain text
#: ../E/extends.txt:106
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|public>public</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|protected>protected</a></code>, <code><a cbot|new>new</a></code>, <code><a cbot|pointer>reference</a></code>, <code><a cbot|this>this</a></code>, <code><a cbot|super>super</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: Plain text
#: ../E/super.txt:2
#, no-wrap
msgid "This keyword is similar to <code><a cbot|this>this</a></code>, however, it grants access to methods from the parent class (see the <code><a cbot|extends>extends</a></code> keyword), which is especially useful for method overriding."
msgstr ""
#. type: Source code
#: ../E/super.txt:6
#, no-wrap
msgid ""
"public class Parent\n"
"{\n"
"\tprotected int field;\n"
"\t\n"
"\tvoid Parent()\n"
"\t{\n"
"\t\tfield = 0;\n"
"\t}\n"
"\t\n"
"\tvoid Print()\n"
"\t{\n"
"\t\tmessage(\"Parent's field: \" + field);\n"
"\t}\n"
"}\n"
"\n"
"public class Child extends Parent\n"
"{\n"
"\tprivate int childsField;\n"
"\t\n"
"\tvoid Child()\n"
"\t{\n"
"\t\tsuper.Parent();\n"
"\t\tchildsField = field + 1;\n"
"\t}\n"
"\t\n"
"\tvoid Print()\n"
"\t{\n"
"\t\tsuper.Print();\n"
"\t\tmessage(\"Child's field: \" + childsField);\n"
"\t}\n"
"}\n"
"\n"
"extern void object::Test()\n"
"{\n"
"\tChild child();\n"
"\tchild.Print(); // Will show both 0 and 1\n"
"}"
msgstr ""
#. type: Plain text
#: ../E/extends.txt:2
#, no-wrap
msgid "This keyword is used in a <code><a cbot|class>class</a></code> definition when we want the class to inherit members from another class. The class which is extended we usually call a parent or base, the extending class we call a child."
msgstr ""
#. type: Source code
#: ../E/extends.txt:6
#, no-wrap
msgid ""
"public class Parent\n"
"{\n"
"\tvoid foo()\n"
"\t{\n"
"\t\tmessage(\"foo\");\n"
"\t}\n"
"}\n"
"\n"
"public class Child extends Parent\n"
"{\n"
"\tvoid bar()\n"
"\t{\n"
"\t\tmessage(\"bar\");\n"
"\t}\n"
"}\n"
"\n"
"extern void object::Test()\n"
"{\n"
"\tChild child();\n"
"\tchild.foo(); // Will show \"foo\"\n"
"\tchild.bar(); // Will show \"bar\"\n"
"}"
msgstr ""
#. type: Plain text
#: ../E/extends.txt:60
#, no-wrap
msgid "A parent's method can be called inside an overriden method by using the <code><a cbot|super>super</a></code> keyword."
msgstr ""
#. type: Plain text
#: ../E/class.txt:56
#, no-wrap
msgid "As shown in the previous example, the class members can be initialized in the class definition (<c/>int x = 3.33;<n/>)."
msgstr ""
#. type: Plain text
#: ../E/open.txt:13
#, no-wrap
msgid ""
"<code>\"r\"</code> mode: open for reading.\n"
"<code>\"w\"</code> mode: open for writing.\n"
"<code>\"a\"</code> mode: open for appending."
msgstr ""
#. type: Plain text
#: ../E/openfile.txt:2
#, no-wrap
msgid "<c/>openfile();<n/> opens an text file in the files/ folder. This is not a method of the <code><a cbot|file>file</a></code> class but openfile returns a <a cbot|pointer>reference</a> to a new instance of the file class. You must supply two parameters, the filename and the opening mode."
msgstr ""
#. type: Plain text
#: ../E/openfile.txt:6
#, no-wrap
msgid ""
"<code>\"r\"</code> mode: open for reading.\n"
"<code>\"w\"</code> mode: open for writing.\n"
"<code>\"w\"</code> mode: open for appending."
msgstr ""

View File

@ -53,13 +53,13 @@ msgid "Time in seconds."
msgstr ""
#. type: \t; header
#: ../E/abstime.txt:10 ../E/acos.txt:11 ../E/aim.txt:23 ../E/array.txt:41 ../E/asin.txt:11 ../E/atan.txt:11 ../E/atan2.txt:16 ../E/bloc.txt:48 ../E/bool.txt:4 ../E/break.txt:24 ../E/build.txt:27 ../E/buildingenabled.txt:22 ../E/busy.txt:14 ../E/canbuild.txt:22 ../E/canresearch.txt:14 ../E/category.txt:109 ../E/ceil.txt:12 ../E/class.txt:70 ../E/close.txt:6 ../E/cond.txt:4 ../E/continue.txt:24 ../E/cos.txt:11 ../E/deletef.txt:9 ../E/delinfo.txt:13 ../E/destroy.txt:15 ../E/detect.txt:27 ../E/direct.txt:13 ../E/dist.txt:29 ../E/dist2d.txt:13 ../E/do.txt:27 ../E/drop.txt:28 ../E/eof.txt:13 ../E/errmode.txt:32 ../E/expr.txt:197 ../E/extern.txt:29 ../E/factory.txt:21 ../E/false.txt:4 ../E/file.txt:16 ../E/fire.txt:30 ../E/flatgrnd.txt:16 ../E/flatspace.txt:25 ../E/float.txt:24 ../E/floor.txt:12 ../E/for.txt:51 ../E/function.txt:129 ../E/goto.txt:34 ../E/grab.txt:28 ../E/if.txt:39 ../E/int.txt:18 ../E/jet.txt:14 ../E/message.txt:24 ../E/motor.txt:38 ../E/move.txt:21 ../E/nan.txt:14 ../E/new.txt:20 ../E/null.txt:4 ../E/object.txt:79 ../E/open.txt:18 ../E/openfile.txt:10 ../E/pencolor.txt:14 ../E/pendown.txt:17 ../E/penup.txt:11 ../E/penwidth.txt:14 ../E/point.txt:35 ../E/pointer.txt:51 ../E/pow.txt:14 ../E/private.txt:17 ../E/produce.txt:30 ../E/public.txt:49 ../E/radar.txt:80 ../E/radarall.txt:19 ../E/rand.txt:8 ../E/readln.txt:18 ../E/receive.txt:16 ../E/recycle.txt:12 ../E/research.txt:18 ../E/researched.txt:14 ../E/researches.txt:27 ../E/retobj.txt:13 ../E/return.txt:29 ../E/round.txt:12 ../E/search.txt:25 ../E/send.txt:17 ../E/shield.txt:18 ../E/sin.txt:11 ../E/sizeof.txt:21 ../E/sniff.txt:16 ../E/space.txt:22 ../E/sqrt.txt:11 ../E/static.txt:20 ../E/strfind.txt:18 ../E/string.txt:32 ../E/strleft.txt:14 ../E/strlen.txt:12 ../E/strlower.txt:10 ../E/strmid.txt:18 ../E/strright.txt:14 ../E/strupper.txt:10 ../E/strval.txt:17 ../E/switch.txt:70 ../E/synchro.txt:23 ../E/takeoff.txt:15 ../E/tan.txt:11 ../E/term.txt:30 ../E/testinfo.txt:16 ../E/this.txt:52 ../E/thump.txt:12 ../E/topo.txt:13 ../E/true.txt:4 ../E/trunc.txt:12 ../E/turn.txt:32 ../E/type.txt:32 ../E/var.txt:66 ../E/void.txt:10 ../E/wait.txt:21 ../E/while.txt:46 ../E/writeln.txt:19
#: ../E/abstime.txt:10 ../E/acos.txt:11 ../E/aim.txt:23 ../E/array.txt:41 ../E/asin.txt:11 ../E/atan.txt:11 ../E/atan2.txt:16 ../E/bloc.txt:48 ../E/bool.txt:4 ../E/break.txt:24 ../E/build.txt:27 ../E/buildingenabled.txt:22 ../E/busy.txt:14 ../E/canbuild.txt:22 ../E/canresearch.txt:14 ../E/category.txt:109 ../E/ceil.txt:12 ../E/class.txt:120 ../E/close.txt:6 ../E/cond.txt:4 ../E/continue.txt:24 ../E/cos.txt:11 ../E/deletef.txt:9 ../E/delinfo.txt:13 ../E/destroy.txt:15 ../E/detect.txt:27 ../E/direct.txt:13 ../E/dist.txt:29 ../E/dist2d.txt:13 ../E/do.txt:27 ../E/drop.txt:28 ../E/eof.txt:13 ../E/errmode.txt:32 ../E/expr.txt:197 ../E/extends.txt:105 ../E/extern.txt:29 ../E/factory.txt:21 ../E/false.txt:4 ../E/file.txt:16 ../E/fire.txt:30 ../E/flatgrnd.txt:16 ../E/flatspace.txt:25 ../E/float.txt:24 ../E/floor.txt:12 ../E/for.txt:51 ../E/function.txt:129 ../E/goto.txt:34 ../E/grab.txt:28 ../E/if.txt:39 ../E/int.txt:18 ../E/jet.txt:14 ../E/message.txt:24 ../E/motor.txt:38 ../E/move.txt:21 ../E/nan.txt:14 ../E/new.txt:20 ../E/null.txt:4 ../E/object.txt:79 ../E/open.txt:19 ../E/openfile.txt:11 ../E/pencolor.txt:14 ../E/pendown.txt:17 ../E/penup.txt:11 ../E/penwidth.txt:14 ../E/point.txt:35 ../E/pointer.txt:51 ../E/pow.txt:14 ../E/private.txt:19 ../E/produce.txt:30 ../E/protected.txt:26 ../E/public.txt:49 ../E/radar.txt:80 ../E/radarall.txt:19 ../E/rand.txt:8 ../E/readln.txt:18 ../E/receive.txt:16 ../E/recycle.txt:12 ../E/research.txt:18 ../E/researched.txt:14 ../E/researches.txt:27 ../E/retobj.txt:13 ../E/return.txt:29 ../E/round.txt:12 ../E/search.txt:25 ../E/send.txt:17 ../E/shield.txt:18 ../E/sin.txt:11 ../E/sizeof.txt:21 ../E/sniff.txt:16 ../E/space.txt:22 ../E/sqrt.txt:11 ../E/static.txt:20 ../E/strfind.txt:18 ../E/string.txt:32 ../E/strleft.txt:14 ../E/strlen.txt:12 ../E/strlower.txt:10 ../E/strmid.txt:18 ../E/strright.txt:14 ../E/strupper.txt:10 ../E/strval.txt:17 ../E/super.txt:45 ../E/switch.txt:70 ../E/synchro.txt:23 ../E/takeoff.txt:15 ../E/tan.txt:11 ../E/term.txt:30 ../E/testinfo.txt:16 ../E/this.txt:52 ../E/thump.txt:12 ../E/topo.txt:13 ../E/true.txt:4 ../E/trunc.txt:12 ../E/turn.txt:32 ../E/type.txt:32 ../E/var.txt:66 ../E/void.txt:10 ../E/wait.txt:21 ../E/while.txt:46 ../E/writeln.txt:19
#, no-wrap
msgid "See also"
msgstr "См. также"
#. type: Plain text
#: ../E/abstime.txt:11 ../E/aim.txt:24 ../E/array.txt:42 ../E/bool.txt:5 ../E/break.txt:25 ../E/busy.txt:15 ../E/cond.txt:5 ../E/continue.txt:25 ../E/deletef.txt:10 ../E/destroy.txt:16 ../E/detect.txt:28 ../E/direct.txt:14 ../E/dist.txt:30 ../E/dist2d.txt:14 ../E/drop.txt:29 ../E/errmode.txt:33 ../E/expr.txt:198 ../E/extern.txt:30 ../E/false.txt:5 ../E/fire.txt:31 ../E/flatgrnd.txt:17 ../E/flatspace.txt:26 ../E/float.txt:25 ../E/for.txt:52 ../E/function.txt:130 ../E/goto.txt:35 ../E/grab.txt:29 ../E/if.txt:40 ../E/int.txt:19 ../E/jet.txt:15 ../E/message.txt:25 ../E/move.txt:22 ../E/nan.txt:15 ../E/object.txt:80 ../E/openfile.txt:11 ../E/pencolor.txt:15 ../E/pendown.txt:18 ../E/penup.txt:12 ../E/penwidth.txt:15 ../E/point.txt:36 ../E/produce.txt:31 ../E/recycle.txt:13 ../E/retobj.txt:14 ../E/return.txt:30 ../E/search.txt:26 ../E/shield.txt:19 ../E/sizeof.txt:22 ../E/sniff.txt:17 ../E/space.txt:23 ../E/string.txt:33 ../E/switch.txt:71 ../E/takeoff.txt:16 ../E/term.txt:31 ../E/thump.txt:13 ../E/topo.txt:14 ../E/true.txt:5 ../E/turn.txt:33 ../E/type.txt:33 ../E/var.txt:67 ../E/void.txt:11 ../E/wait.txt:22
#: ../E/abstime.txt:11 ../E/aim.txt:24 ../E/array.txt:42 ../E/bool.txt:5 ../E/break.txt:25 ../E/busy.txt:15 ../E/cond.txt:5 ../E/continue.txt:25 ../E/deletef.txt:10 ../E/destroy.txt:16 ../E/detect.txt:28 ../E/direct.txt:14 ../E/dist.txt:30 ../E/dist2d.txt:14 ../E/drop.txt:29 ../E/errmode.txt:33 ../E/expr.txt:198 ../E/extern.txt:30 ../E/false.txt:5 ../E/fire.txt:31 ../E/flatgrnd.txt:17 ../E/flatspace.txt:26 ../E/float.txt:25 ../E/for.txt:52 ../E/function.txt:130 ../E/goto.txt:35 ../E/grab.txt:29 ../E/if.txt:40 ../E/int.txt:19 ../E/jet.txt:15 ../E/message.txt:25 ../E/move.txt:22 ../E/nan.txt:15 ../E/object.txt:80 ../E/openfile.txt:12 ../E/pencolor.txt:15 ../E/pendown.txt:18 ../E/penup.txt:12 ../E/penwidth.txt:15 ../E/point.txt:36 ../E/produce.txt:31 ../E/recycle.txt:13 ../E/retobj.txt:14 ../E/return.txt:30 ../E/search.txt:26 ../E/shield.txt:19 ../E/sizeof.txt:22 ../E/sniff.txt:17 ../E/space.txt:23 ../E/string.txt:33 ../E/switch.txt:71 ../E/takeoff.txt:16 ../E/term.txt:31 ../E/thump.txt:13 ../E/topo.txt:14 ../E/true.txt:5 ../E/turn.txt:33 ../E/type.txt:33 ../E/var.txt:67 ../E/void.txt:11 ../E/wait.txt:22
#, no-wrap
msgid "<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr "<a cbot>Программирование</a>, <a cbot|type>типы</a> и <a cbot|category>категории</a>."
@ -579,12 +579,6 @@ msgstr "<a cbot>Язык CBOT</a> и <a cbot|type>Переменные</a>."
msgid "Instruction <code>class</code>"
msgstr "Инструкция <code>class</code>"
#. type: Plain text
#: ../E/class.txt:2
#, no-wrap
msgid "This allows you to declare a class definition using following syntax:"
msgstr "Синтаксис:"
#. type: Source code
#: ../E/class.txt:4
#, no-wrap
@ -599,164 +593,6 @@ msgstr ""
"\tdeclarations;\n"
"}"
#. type: Plain text
#: ../E/class.txt:9
#, no-wrap
msgid "Classes can only be <a cbot|public>public</a>, that is they can be used from all bots in a mission. Class members are also public, that is they are accessible from outside the class. Class members can be fields or functions (also called methods), for example the followin class <code>MyClass</code> contains 4 fields (a, b, x and s) and one method (MyFunction)."
msgstr "Классы должны быть <a cbot|public>общедоступными</a>, таким образом они могут быть исползованы всеми ботами в любой миссии. Члены класса также должны быть общедоступными, тоесть должны быть доступны за пределами класса. Членами класса могут быть ячейки и функции (по-другому методы), например следующий класс <code>MyClass</code> содержит 4 ячейки (a, b, x и s) и один метод (MyFunction)."
#. type: Source code
#: ../E/class.txt:11
#, no-wrap
msgid ""
"public class MyClass\n"
"{\n"
"\tint a, b;\n"
"\tfloat x = 3.33;\n"
"\tstring s = \"hello\";\n"
"\tfloat MyFunction( float value )\n"
"\t{\n"
"\t\treturn (value*x)-1;\n"
"\t}\n"
"}"
msgstr ""
"public class MyClass\n"
"{\n"
"\tint a, b;\n"
"\tfloat x = 3.33;\n"
"\tstring s = \"hello\";\n"
"\tfloat MyFunction( float value )\n"
"\t{\n"
"\t\treturn (value*x)-1;\n"
"\t}\n"
"}"
#. type: Plain text
#: ../E/class.txt:22
#, no-wrap
msgid "As shown in this exemple the class members can be initialized (<code>x=3.33</code>). You can also define a constructor which is a special method having the same name as the class name. This method will be called automatically at creation time of a class instance. You can also declare more than one method with the same name but different parameters."
msgstr "ак показано в данном примере члены класса могут быть инициализированы (<code>x=3.33</code>). Вы можете также определить конструктор, который представляет собой специальный метод, имеющий то же имя, как и имя класса. Этот метод будет вызван автоматически в момент создания экземпляра класса. Вы можете также объявить более одного метода с тем же именем, но с разными параметрами."
#. type: Source code
#: ../E/class.txt:24
#, no-wrap
msgid ""
"public class MyClass\n"
"{\n"
"\tint a, b;\n"
"\tvoid MyClass( )\n"
"\t{\n"
"\t\ta = 2; b = 3;\n"
"\t}\n"
"\tvoid MyClass( int a, int b )\n"
"\t{\n"
"\t\tthis.a = a; this.b = b;\n"
"\t}\n"
"}"
msgstr ""
"public class MyClass\n"
"{\n"
"\tint a, b;\n"
"\tvoid MyClass( )\n"
"\t{\n"
"\t\ta = 2; b = 3;\n"
"\t}\n"
"\tvoid MyClass( int a, int b )\n"
"\t{\n"
"\t\tthis.a = a; this.b = b;\n"
"\t}\n"
"}"
#. type: Plain text
#: ../E/class.txt:37
#, no-wrap
msgid "In this example two constructors are declared for <code>MyClass</code>, one without parameters and the other one with two parameters. As the names of the parameters of the second constructor are the same as the names of the two members <code>a</code> et <code>b</code> we must use the <code><a cbot|this>this</a>.a</code> and <code><a cbot|this>this</a>.b</code> to avoid confusion with the parameters. Another more simpler solution would be to give different names to the parameters."
msgstr "В этом примере два конструктора были объявлены как <code>MyClass</code>, один без параметров и второй с двумя параметрами. Поскольку имена параметров второго конструктора такие же, как и имена двух членов <code>a</code> и <code>b</code> мы должны использовать <code><a cbot|this>this</a>.a</code> и <code><a cbot|this>this</a>.b</code> чтобы избежать путаницы с параметрами. Наболее простым решением было бы дать разные имена параметрам."
#. type: Source code
#: ../E/class.txt:39
#, no-wrap
msgid ""
"void Test( )\n"
"{\n"
"\tMyClass item1(); // constr. w/o parameters\n"
"\tMyClass item2(4, 5); // constr. with 2 parameters\n"
"\tMyClass item3; // no constructor called,\n"
" // therefore item3 == null\n"
"}"
msgstr ""
"void Test( )\n"
"{\n"
"\tMyClass item1(); // конструктор без параметров\n"
"\tMyClass item2(4, 5); // конструктор с двумя параметрами\n"
"\tMyClass item3; // нет вызова конструктора,\n"
" // поэтому item3 == null\n"
"}"
#. type: Plain text
#: ../E/class.txt:47
#, no-wrap
msgid "You can also define a destructor. This must be a <code>void</code> fonction without parameters that has the same name as the class name but prefixed by the ~ character. The destructor is called automatically as soon as the class instance is no more referenced by anyone."
msgstr "Вы также можете определить деструктор. Это должна быть <code>пустая(void)</code> функция без параметров, имеющая то же имя, что и класс, но с первиксом ~. Деструктор вызывается автоматически, как только класс уже больше никому не понадобится."
#. type: Source code
#: ../E/class.txt:49
#, no-wrap
msgid ""
"public class MyClass\n"
"{\n"
"\tstatic private int counter = 0; // instance counter\n"
"\tvoid MyClass( )\n"
"\t{\n"
"\t\tcounter ++; // one instance more\n"
"\t}\n"
"\tvoid ~MyClass( )\n"
"\t{\n"
"\t\tcounter --; // one instance less\n"
"\t}\n"
"}\n"
"void Test()\n"
"{\n"
"\tMyClass item1( ); // counter = 1\n"
"\tMyClass item2( ); // counter = 2\n"
"\titem1 = null; // counter = 1\n"
"} // counter = 0"
msgstr ""
"public class MyClass\n"
"{\n"
"\tstatic private int counter = 0; // инициализируем счетчик\n"
"\tvoid MyClass( )\n"
"\t{\n"
"\t\tcounter ++; // увеличиваем\n"
"\t}\n"
"\tvoid ~MyClass( )\n"
"\t{\n"
"\t\tcounter --; // уменьшаем\n"
"\t}\n"
"}\n"
"void Test()\n"
"{\n"
"\tMyClass item1( ); // счетчик = 1\n"
"\tMyClass item2( ); // счетчик = 2\n"
"\titem1 = null; // счетчик = 1\n"
"} // счетчик = 0"
#. type: Plain text
#: ../E/class.txt:68
#, no-wrap
msgid "If you pass a class instance as parameter to a <a cbot|function>function</a>, the function only receives a <a cbot|pointer>reference</a> to the instance. That means if you modify the instance in the function, the instance that has been passed to the function will be actuallay modified."
msgstr "If you pass a class instance as parameter to a <a cbot|function>function</a>, the function only receives a <a cbot|pointer>reference</a> to the instance. That means if you modify the instance in the function, the instance that has been passed to the function will be actuallay modified."
#. type: Plain text
#: ../E/class.txt:71
#, no-wrap
msgid ""
"<code><a cbot|public>public</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|static>static</a></code>, <code><a cbot|synchro>synchronized</a></code>, <code><a cbot|new>new</a></code>, <code><a cbot|pointer>reference</a></code>, <code><a cbot|this>this</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
"<code><a cbot|public>Общедоступное</a></code>, <code><a cbot|private>приватное</a></code>, <code><a cbot|static>статичное</a></code>, <code><a cbot|synchro>синхронизированное</a></code>, <code><a cbot|new>новое</a></code>, <code><a cbot|pointer>ссылка</a></code>, <code><a cbot|this>это</a></code>\n"
"<a cbot>Язык CBOT</a> и <a cbot|type>Переменные</a> и <a cbot|category>категории</a>."
#. type: \b; header
#: ../E/close.txt:1
#, no-wrap
@ -2812,23 +2648,13 @@ msgstr ""
"\thandle.close();"
#. type: Plain text
#: ../E/open.txt:13 ../E/openfile.txt:6
#, no-wrap
msgid ""
"<code>\"r\"</code> mode: open for reading.\n"
"<code>\"w\"</code> mode: open for writing."
msgstr ""
"<code>\"r\"</code> mode: открыть для чтения.\n"
"<code>\"w\"</code> mode: открыть для записи."
#. type: Plain text
#: ../E/open.txt:16
#: ../E/open.txt:17
#, no-wrap
msgid "Files can only be created and opened in the files/ folder which is located in the folder where Colobot has been installed. You cannot not create or open files that are located elsewhere than in the files/ folder."
msgstr "Файлы могут находиться только в папке с установленной игрой."
#. type: Plain text
#: ../E/open.txt:19
#: ../E/open.txt:20
#, no-wrap
msgid ""
"<code><a cbot|file>file</a></code>, <code><a cbot|close>close</a></code>, <code><a cbot|readln>readln</a></code>, <code><a cbot|writeln>writeln</a></code> and <code><a cbot|eof>eof</a></code>.\n"
@ -2843,12 +2669,6 @@ msgstr ""
msgid "Instruction <code>openfile</code>"
msgstr "Инструкция <code>openfile</code>"
#. type: Plain text
#: ../E/openfile.txt:2
#, no-wrap
msgid "<c/>openfile();<n/> opens an text file in the files/ folder. This is not a method of the <code><a cbot|file>file</a></code> class but openfile returne a <a cbot|pointer>reference</a> to a new instance of the file class. You must supply two parameters, the filename and the opening mode."
msgstr "<c/>openfile();<n/> открывает файл. Это не метод класса <code><a cbot|file>file</a></code>, однако openfile возвращает <a cbot|pointer>ссылку</a> для нового экземпляра класса. Вы должны указать два параметра - имя файла и режим открытия."
#. type: Source code
#: ../E/openfile.txt:4
#, no-wrap
@ -3131,14 +2951,8 @@ msgstr ""
msgid "Instruction <code>private</code> (for specialists)"
msgstr "Инструкция <code>private</code> (for specialists)"
#. type: Plain text
#: ../E/private.txt:2
#, no-wrap
msgid "<a cbot|class>Class</a> members can be <a cbot|public>public</a> (by default) or private. A member can be declared private by putting <code>private</code> before the type declaration of the member. Private members are not accessible from outside the class definition."
msgstr "Члены <a cbot|class>класса</a> могут быть <a cbot|public>общедоступны</a> (по-умолчанию) или личными. Член может быть объявлен частным, если поставить <code>private</code> до объявления элемента. Личные(локальные) члены не доступны извне для других классов."
#. type: Source code
#: ../E/private.txt:4
#: ../E/private.txt:6
#, no-wrap
msgid ""
"public class MyClass\n"
@ -3167,16 +2981,6 @@ msgstr ""
"\tmessage( item.position ); // это ошибка\n"
"}"
#. type: Plain text
#: ../E/private.txt:18
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|public>public</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
"<code><a cbot|class>class</a></code>, <code><a cbot|public>public</a></code>\n"
"<a cbot>Программирование</a>, <a cbot|type>типы</a> и <a cbot|category>категории</a>."
#. type: \b; header
#: ../E/public.txt:1
#, no-wrap
@ -3281,12 +3085,6 @@ msgstr "Если бот, содержащий <code>общедоступную</
msgid "Instruction <code>public</code> for classes"
msgstr "Инструкция <code>public</code> для классов"
#. type: Plain text
#: ../E/public.txt:34
#, no-wrap
msgid "<a cbot|class>Class</a> members can be public (by default) or <a cbot|private>privat</a>. A member can be declared private by putting <code>private</code> before the member type. Private members are not accessible from outside the class definition."
msgstr "Член <a cbot|class>класса</a> может быть общедоступен (по-умолчанию) или <a cbot|private>быть личным</a>. Член может быть объявлен локальным с помощью <code>private</code>, написав это перед самим членом. Закрытые члены будут недоступны извне для других классов."
#. type: Source code
#: ../E/public.txt:36
#, no-wrap
@ -3317,16 +3115,6 @@ msgstr ""
"\tmessage( item.position ); // это ошибка\n"
"}"
#. type: Plain text
#: ../E/public.txt:50
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|function>functions</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
"<code><a cbot|class>class</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|function>functions</a></code>\n"
"<a cbot>Программирование</a>, <a cbot|type>типы</a> и <a cbot|category>категории</a>."
#. type: \b; header
#: ../E/radar.txt:1
#, no-wrap
@ -4907,16 +4695,6 @@ msgstr ""
"\t}\n"
"}"
#. type: Plain text
#: ../E/this.txt:53
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
"<code><a cbot|class>class</a></code>\n"
"<a cbot>Программирование</a>, |l:типы\\u cbot<type/> и <a cbot\\category>категории</a>."
#. type: \b; header
#: ../E/thump.txt:1
#, no-wrap
@ -8019,7 +7797,7 @@ msgid "Firstly, the condition is valued and then the first result is returned if
msgstr ""
#. type: \t; header
#: ../E/expr.txt:157
#: ../E/expr.txt:157 ../E/extends.txt:4 ../E/extends.txt:65 ../E/private.txt:4 ../E/protected.txt:4 ../E/super.txt:4
#, no-wrap
msgid "Example"
msgstr ""
@ -8285,3 +8063,600 @@ msgid ""
" <code><a object|target1>Target1</a> </code>Flying target\n"
" <code><a object|nest>AlienNest</a> </code>Alien Nest"
msgstr ""
#. type: Plain text
#: ../E/class.txt:10
#, no-wrap
msgid "Classes can be only <a cbot|public>public</a>. This means that they can be used by all bots in a mission."
msgstr ""
#. type: \b; header
#: ../E/class.txt:12
#, no-wrap
msgid "Class Members"
msgstr ""
#. type: Plain text
#: ../E/class.txt:13
#, no-wrap
msgid "Class members are fields (<a cbot|var>variables</a>) and methods (<a cbot|function>functions</a>)."
msgstr ""
#. type: Plain text
#: ../E/class.txt:15
#, no-wrap
msgid "For example, the following class dubbed <code>MyClass</code> contains 4 fields (<code>a</code>, <code>b</code>, <code>x</code> and <code>s</code>) and one method (<code>MyFunction</code>)."
msgstr ""
#. type: Source code
#: ../E/class.txt:17
#, no-wrap
msgid ""
"public class MyClass\n"
"{\n"
"\tint a, b;\n"
"\tfloat x = 3.33;\n"
"\tstring s = \"hello\";\n"
"\tfloat MyFunction(float value)\n"
"\t{\n"
"\t\treturn (value * x) - 1;\n"
"\t}\n"
"}"
msgstr ""
#. type: \t; header
#: ../E/class.txt:55
#, no-wrap
msgid "Member Initialization"
msgstr ""
#. type: Plain text
#: ../E/class.txt:60
#, no-wrap
msgid "Example:<c/>"
msgstr ""
#. type: Source code
#: ../E/class.txt:61
#, no-wrap
msgid ""
"public class MyClass\n"
"{\n"
"\tint a, b;\n"
"\tvoid MyClass()\n"
"\t{\n"
"\t\ta = 2; b = 3;\n"
"\t}\n"
"\tvoid MyClass(int a, int b)\n"
"\t{\n"
"\t\tthis.a = a; this.b = b;\n"
"\t}\n"
"}"
msgstr ""
#. type: Plain text
#: ../E/class.txt:76
#, no-wrap
msgid "As the names of the parameters of the second constructor are the same as the names of the two members <code>a</code> and <code>b</code>, we must use the <code><a cbot|this>this</a></code> <a cbot|pointer>reference</a> to avoid confusion with the parameters' names."
msgstr ""
#. type: \b; header
#: ../E/class.txt:78
#, no-wrap
msgid "Object Creation"
msgstr ""
#. type: Plain text
#: ../E/class.txt:79
#, no-wrap
msgid "You can create objects of type <code>YourClass</code> using the <code><a cbot|new>new</a></code> keyword. Example:"
msgstr ""
#. type: \b; header
#: ../E/class.txt:90
#, no-wrap
msgid "Object Destruction"
msgstr ""
#. type: \b; header
#: ../E/class.txt:114
#, no-wrap
msgid "Passing Objects to Functions"
msgstr ""
#. type: Plain text
#: ../E/class.txt:115
#, no-wrap
msgid "Objects in CBOT are passed by <a cbot|pointer>reference</a>. This means that when an object is passed to a <a cbot|function>function</a>, the function receives a copy of a pointer to the instance, not a copy of the object, so any modifications on the object will be visible outside of the function."
msgstr ""
#. type: \b; header
#: ../E/class.txt:117
#, no-wrap
msgid "Inheritance"
msgstr ""
#. type: Plain text
#: ../E/class.txt:118
#, no-wrap
msgid "A class can inherit public and protected members of another class by using the <code><a cbot|extends>extends</a></code> keyword."
msgstr ""
#. type: Plain text
#: ../E/class.txt:2
#, no-wrap
msgid "This keyword allows you to create a class definition by using the following syntax:"
msgstr ""
#. type: \t; header
#: ../E/class.txt:9
#, no-wrap
msgid "All Classes Are Public"
msgstr ""
#. type: \t; header
#: ../E/class.txt:52
#, no-wrap
msgid "Class Members Modifiers"
msgstr ""
#. type: \t; header
#: ../E/class.txt:75
#, no-wrap
msgid "Using <code><a cbot|this>this</a></code>"
msgstr ""
#. type: Source code
#: ../E/class.txt:81
#, no-wrap
msgid ""
"extern void object::Test()\n"
"{\n"
"\tMyClass object1(); // Call default constructor (without parameters)\n"
"\tMyClass object2(4, 5); // Call constructor with two int parameters\n"
"\tMyClass object3; // No constructor called, object3 == null\n"
"\tobject3 = new MyClass(); // We call constructor now, object3 != null\n"
"}"
msgstr ""
#. type: Plain text
#: ../E/class.txt:91
#, no-wrap
msgid "You can also define a destructor. This must be a <code><a cbot|void>void</a></code> fonction without parameters, which has the same name as the class but prefixed with the <code>~</code> character. The destructor is called automatically as soon as the class instance is no more referenced by anyone. Example:"
msgstr ""
#. type: Source code
#: ../E/class.txt:93
#, no-wrap
msgid ""
"public class MyClass\n"
"{\n"
"\tstatic private int counter = 0; // instance counter\n"
"\tvoid MyClass( )\n"
"\t{\n"
"\t\tcounter++; // one instance more\n"
"\t}\n"
"\tvoid ~MyClass( )\n"
"\t{\n"
"\t\tcounter--; // one instance less\n"
"\t}\n"
"}\n"
"extern void object::Test()\n"
"{\n"
"\t // counter == 0\n"
"\tMyClass item1( ); // counter == 1\n"
"\tMyClass item2( ); // counter == 2\n"
"\titem1 = null; // counter == 1\n"
"}\n"
"// counter == 0"
msgstr ""
#. type: \b; header
#: ../E/class.txt:28
#, no-wrap
msgid "Accessing Class Members"
msgstr ""
#. type: Plain text
#: ../E/class.txt:29
#, no-wrap
msgid "Class members can be accessed outside of the class definition by using the <code>.</code> operator. Example:"
msgstr ""
#. type: Plain text
#: ../E/class.txt:50
#, no-wrap
msgid "Class members are <a cbot|public>public</a> by default, which means that they are accessible outside of the class definition. They can also be declared as <code><a cbot|private>private</a></code> or <code><a cbot|protected>protected</a></code>. Such members can only be accessed inside of the class definition."
msgstr ""
#. type: Plain text
#: ../E/class.txt:53
#, no-wrap
msgid "Fields and methods can also be declared as <code><a cbot|static>static</a></code>. Methods can be additionaly declared as <code><a cbot|synchro>synchronized</a></code>."
msgstr ""
#. type: Plain text
#: ../E/class.txt:58
#, no-wrap
msgid "Another way of initiliazing fields is by defining a constructor which is a special method having the same name as the class. This method will be called automatically at <a cbot|new>creation</a> time of a class instance. Constructors can be <a cbot|function>overloaded</a>."
msgstr ""
#. type: Source code
#: ../E/class.txt:31
#, no-wrap
msgid ""
"public class MyClass\n"
"{\n"
"\tint myField = 0;\n"
"\tint MyFunction()\n"
"\t{\n"
"\t\treturn myField * 2;\n"
"\t}\n"
"}\n"
"\n"
"extern void object::Test()\n"
"{\n"
"\tMyClass myObject();\n"
"\tmyObject.myField = 10;\n"
"\tmessage(myObject.MyFunction()); // 20\n"
"\tMyClass mySecondObject();\n"
"\tmySecondObject.myField = myObject.myField - 2;\n"
"\tmessage(mySecondObject.MyFunction()); // 16\n"
"}"
msgstr ""
#. type: Plain text
#: ../E/class.txt:121
#, no-wrap
msgid ""
"<code><a cbot|public>public</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|protected>protected</a></code>, <code><a cbot|static>static</a></code>, <code><a cbot|synchro>synchronized</a></code>, <code><a cbot|new>new</a></code>, <code><a cbot|pointer>reference</a></code>, <code><a cbot|this>this</a></code>, <code><a cbot|super>super</a></code>, <code><a cbot|extends>extends</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: \b; header
#: ../E/protected.txt:1
#, no-wrap
msgid "Keyword <code>protected</code>"
msgstr ""
#. type: Plain text
#: ../E/protected.txt:2
#, no-wrap
msgid "This is an access modifier for <a cbot|class>class</a> members. Protected class members can be accessed in a child class, but they can't be accessed outside of classes definitions being part of the same inheritance tree (see the <code><a cbot|extends>extends</a></code> keyword)."
msgstr ""
#. type: Source code
#: ../E/protected.txt:6
#, no-wrap
msgid ""
"public class Parent\n"
"{\n"
"\tprotected int field = 0;\n"
"}\n"
"\n"
"public class Child extends Parent\n"
"{\n"
"\tvoid Print()\n"
"\t{\n"
"\t\tmessage(field);\n"
"\t}\n"
"}\n"
"\n"
"extern void object::Test()\n"
"{\n"
"\tChild child();\n"
"\tchild.Print(); // 0\n"
"\t//child.field = 1; // Error!\n"
"}"
msgstr ""
#. type: Plain text
#: ../E/private.txt:2
#, no-wrap
msgid "This is an access modifier for <a cbot|class>class</a> members. Private members are not accessible outside of the class definition."
msgstr ""
#. type: Plain text
#: ../E/private.txt:20
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|public>public</a></code>, <code><a cbot|protected>protected</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: Plain text
#: ../E/public.txt:34
#, no-wrap
msgid "<code>public</code> is also an access modifier for <a cbot|class>class</a> members, which is the default one. Public members can be accessed from outside of the class definition."
msgstr ""
#. type: Plain text
#: ../E/public.txt:50
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|protected>protected</a></code>, <code><a cbot|function>functions</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: Plain text
#: ../E/protected.txt:27
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|public>public</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|extends>extends</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: \b; header
#: ../E/super.txt:1
#, no-wrap
msgid "Keyword <code>super</code>"
msgstr ""
#. type: Plain text
#: ../E/super.txt:46
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|this>this</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: Plain text
#: ../E/this.txt:53
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|super>super</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: \b; header
#: ../E/extends.txt:1
#, no-wrap
msgid "Keyword <code>extends</code>"
msgstr ""
#. type: \b; header
#: ../E/extends.txt:30
#, no-wrap
msgid "Inherited Members"
msgstr ""
#. type: Plain text
#: ../E/extends.txt:31
#, no-wrap
msgid "Only <code><a cbot|public>public</a></code> and <code><a cbot|protected>protected</a></code> members are inherited. <code><a cbot|private>private</a></code> members are directly inaccessible even for a child, although they can be accessed indirectly through inherited methods."
msgstr ""
#. type: Plain text
#: ../E/extends.txt:33
#, no-wrap
msgid "Constructors and destructors are not inherited, however, they can be overriden."
msgstr ""
#. type: \b; header
#: ../E/extends.txt:35
#, no-wrap
msgid "Method Overriding"
msgstr ""
#. type: Plain text
#: ../E/extends.txt:36
#, no-wrap
msgid "Inherited methods can be overriden (redefined) in the child class definition. Example:"
msgstr ""
#. type: Source code
#: ../E/extends.txt:38
#, no-wrap
msgid ""
"public class Parent\n"
"{\n"
"\tvoid foo()\n"
"\t{\n"
"\t\tmessage(\"foo\");\n"
"\t}\n"
"}\n"
"\n"
"public class Child extends Parent\n"
"{\n"
"\tvoid foo()\n"
"\t{\n"
"\t\tmessage(\"bar\");\n"
"\t}\n"
"}\n"
"\n"
"extern void object::Test()\n"
"{\n"
"\tChild child();\n"
"\tchild.foo(); // Will show \"bar\"\n"
"}"
msgstr ""
#. type: \b; header
#: ../E/extends.txt:62
#, no-wrap
msgid "Polymorphism"
msgstr ""
#. type: Plain text
#: ../E/extends.txt:63
#, no-wrap
msgid "<code><a cbot|pointer>Reference</a></code> of type Parent can point to an object of type Child. However, such a pointer can't be used to access a child member. In order to access a child member, it must be assured that the Parent reference really points to a Child object. If that's the case, it can be safely copied to a pointer of type Child, which has access to the child members."
msgstr ""
#. type: Source code
#: ../E/extends.txt:67
#, no-wrap
msgid ""
"public class Parent\n"
"{\n"
"\tvoid foo()\n"
"\t{\n"
"\t\tmessage(\"foo\");\n"
"\t}\n"
"}\n"
"\n"
"public class Child extends Parent\n"
"{\n"
"\tvoid foo()\n"
"\t{\n"
"\t\tmessage(\"bar\");\n"
"\t}\n"
"\tvoid bar()\n"
"\t{\n"
"\t\tmessage(\"foo bar\");\n"
"\t}\n"
"}\n"
"\n"
"extern void object::Test()\n"
"{\n"
"\tParent people[2];\n"
"\tpeople[0] = new Parent();\n"
"\tpeople[1] = new Child();\n"
"\tfor (int i = 0; i < 2; ++i)\n"
"\t{\n"
"\t\tpeople[i].foo();\n"
"\t}\n"
"\t//people[1].bar(); // Error\n"
"\tChild child = people[1];\n"
"\tchild.bar(); // OK\n"
"}"
msgstr ""
#. type: \b; header
#: ../E/extends.txt:102
#, no-wrap
msgid "Multiple Inheritance"
msgstr ""
#. type: Plain text
#: ../E/extends.txt:103
#, no-wrap
msgid "A child cannot have multiple parents, however, a parent can have many children."
msgstr ""
#. type: Plain text
#: ../E/extends.txt:106
#, no-wrap
msgid ""
"<code><a cbot|class>class</a></code>, <code><a cbot|public>public</a></code>, <code><a cbot|private>private</a></code>, <code><a cbot|protected>protected</a></code>, <code><a cbot|new>new</a></code>, <code><a cbot|pointer>reference</a></code>, <code><a cbot|this>this</a></code>, <code><a cbot|super>super</a></code>\n"
"<a cbot>Programming</a>, <a cbot|type>types</a> and <a cbot|category>categories</a>."
msgstr ""
#. type: Plain text
#: ../E/super.txt:2
#, no-wrap
msgid "This keyword is similar to <code><a cbot|this>this</a></code>, however, it grants access to methods from the parent class (see the <code><a cbot|extends>extends</a></code> keyword), which is especially useful for method overriding."
msgstr ""
#. type: Source code
#: ../E/super.txt:6
#, no-wrap
msgid ""
"public class Parent\n"
"{\n"
"\tprotected int field;\n"
"\t\n"
"\tvoid Parent()\n"
"\t{\n"
"\t\tfield = 0;\n"
"\t}\n"
"\t\n"
"\tvoid Print()\n"
"\t{\n"
"\t\tmessage(\"Parent's field: \" + field);\n"
"\t}\n"
"}\n"
"\n"
"public class Child extends Parent\n"
"{\n"
"\tprivate int childsField;\n"
"\t\n"
"\tvoid Child()\n"
"\t{\n"
"\t\tsuper.Parent();\n"
"\t\tchildsField = field + 1;\n"
"\t}\n"
"\t\n"
"\tvoid Print()\n"
"\t{\n"
"\t\tsuper.Print();\n"
"\t\tmessage(\"Child's field: \" + childsField);\n"
"\t}\n"
"}\n"
"\n"
"extern void object::Test()\n"
"{\n"
"\tChild child();\n"
"\tchild.Print(); // Will show both 0 and 1\n"
"}"
msgstr ""
#. type: Plain text
#: ../E/extends.txt:2
#, no-wrap
msgid "This keyword is used in a <code><a cbot|class>class</a></code> definition when we want the class to inherit members from another class. The class which is extended we usually call a parent or base, the extending class we call a child."
msgstr ""
#. type: Source code
#: ../E/extends.txt:6
#, no-wrap
msgid ""
"public class Parent\n"
"{\n"
"\tvoid foo()\n"
"\t{\n"
"\t\tmessage(\"foo\");\n"
"\t}\n"
"}\n"
"\n"
"public class Child extends Parent\n"
"{\n"
"\tvoid bar()\n"
"\t{\n"
"\t\tmessage(\"bar\");\n"
"\t}\n"
"}\n"
"\n"
"extern void object::Test()\n"
"{\n"
"\tChild child();\n"
"\tchild.foo(); // Will show \"foo\"\n"
"\tchild.bar(); // Will show \"bar\"\n"
"}"
msgstr ""
#. type: Plain text
#: ../E/extends.txt:60
#, no-wrap
msgid "A parent's method can be called inside an overriden method by using the <code><a cbot|super>super</a></code> keyword."
msgstr ""
#. type: Plain text
#: ../E/class.txt:56
#, no-wrap
msgid "As shown in the previous example, the class members can be initialized in the class definition (<c/>int x = 3.33;<n/>)."
msgstr ""
#. type: Plain text
#: ../E/open.txt:13
#, no-wrap
msgid ""
"<code>\"r\"</code> mode: open for reading.\n"
"<code>\"w\"</code> mode: open for writing.\n"
"<code>\"a\"</code> mode: open for appending."
msgstr ""
#. type: Plain text
#: ../E/openfile.txt:2
#, no-wrap
msgid "<c/>openfile();<n/> opens an text file in the files/ folder. This is not a method of the <code><a cbot|file>file</a></code> class but openfile returns a <a cbot|pointer>reference</a> to a new instance of the file class. You must supply two parameters, the filename and the opening mode."
msgstr ""
#. type: Plain text
#: ../E/openfile.txt:6
#, no-wrap
msgid ""
"<code>\"r\"</code> mode: open for reading.\n"
"<code>\"w\"</code> mode: open for writing.\n"
"<code>\"w\"</code> mode: open for appending."
msgstr ""

View File

@ -84,12 +84,15 @@ Constants like \l;categories\u cbot\category; are displayed like that: \const;co
\t;Specific instructions for classes:
\c;\l;class\u cbot\class; \n;Class declararion
\c;\l;public\u cbot\public; \n;Declares a public function
\c;\l;public\u cbot\public; \n;Declares a public class member
\c;\l;private\u cbot\private; \n;Declares a private class member
\c;\l;protected\u cbot\protected; \n;Declares a protected class member
\c;\l;static\u cbot\static; \n;Declares a static class member
\c;\l;synchronized\u cbot\synchro; \n;Prevents simultaneous execution
\c;\l;new\u cbot\new; \n;Creates a new instance
\c;\l;this\u cbot\this; \n;Reference to the current instance
\c;\l;extends\u cbot\extends; \n;Extends a class
\c;\l;super\u cbot\super; \n;Grants access to the parent class
\t;Specific instructions for strings:
\c;\l;strlen\u cbot\strlen; \n;Gets string length

View File

@ -124,34 +124,14 @@ msgstr ""
msgid "Specific instructions for classes:"
msgstr "Befehle für die Verwaltung von Klassen:"
#. type: Plain text
#: ../E/cbot.txt:86
#, no-wrap
msgid ""
"<code><a cbot|class>class</a> </code>Class declararion\n"
"<code><a cbot|public>public</a> </code>Declares a public function\n"
"<code><a cbot|private>private</a> </code>Declares a private class member\n"
"<code><a cbot|static>static</a> </code>Declares a static class member\n"
"<code><a cbot|synchro>synchronized</a> </code>Prevents simultaneous execution\n"
"<code><a cbot|new>new</a> </code>Creates a new instance\n"
"<code><a cbot|this>this</a> </code>Reference to the current instance"
msgstr ""
"<code><a cbot|class>class</a> </code>Deklaration einer Klasse\n"
"<code><a cbot|public>public</a> </code>Deklaration einer öffentliche Funktion\n"
"<code><a cbot|private>private</a> </code>Deklaration eines privaten Gliedes\n"
"<code><a cbot|static>static</a> </code>Deklaration eines statischen Gliedes\n"
"<code><a cbot|synchro>synchronized</a> </code>Verhindert gleichzeitige Ausführung\n"
"<code><a cbot|new>new</a> </code>Erstellt eine neue Instanz\n"
"<code><a cbot|this>this</a> </code>Bezieht sich auf die laufende Instanz"
#. type: \t; header
#: ../E/cbot.txt:94
#: ../E/cbot.txt:97
#, no-wrap
msgid "Specific instructions for strings:"
msgstr "Befehle für die Verarbeitung von Strings (Zeichenketten):"
#. type: Plain text
#: ../E/cbot.txt:95
#: ../E/cbot.txt:98
#, no-wrap
msgid ""
"<code><a cbot|strlen>strlen</a> </code>Gets string length\n"
@ -173,13 +153,13 @@ msgstr ""
"<code><a cbot|strlower>strlower</a> </code>Umwandlung in Kleinbuchstaben"
#. type: \t; header
#: ../E/cbot.txt:104
#: ../E/cbot.txt:107
#, no-wrap
msgid "Specific instructions for files:"
msgstr "Befehle für die Dateiverwaltung:"
#. type: Plain text
#: ../E/cbot.txt:105
#: ../E/cbot.txt:108
#, no-wrap
msgid ""
"<code><a cbot|open>open</a> </code>Opens a file\n"
@ -197,13 +177,13 @@ msgstr ""
"<code><a cbot|deletef>deletefile</a> </code>Löscht eine Datei"
#. type: \t; header
#: ../E/battles.txt:53 ../E/cbot.txt:128 ../E/freehelp.txt:4
#: ../E/battles.txt:53 ../E/cbot.txt:131 ../E/freehelp.txt:4
#, no-wrap
msgid "See also"
msgstr "Siehe auch"
#. type: Plain text
#: ../E/cbot.txt:129
#: ../E/cbot.txt:132
#, no-wrap
msgid "<a cbot|type>Types</a> and <a cbot|category>categories</a>."
msgstr "<a cbot|type>Variablentypen</a> und <a cbot|category>Kategorien</a>."
@ -680,13 +660,13 @@ msgid ""
msgstr ""
#. type: \t; header
#: ../E/cbot.txt:112
#: ../E/cbot.txt:115
#, no-wrap
msgid "Mathematical functions:"
msgstr ""
#. type: Plain text
#: ../E/cbot.txt:113
#: ../E/cbot.txt:116
#, no-wrap
msgid ""
"<code><a cbot|rand>rand</a> </code>Returns a random value\n"
@ -1094,3 +1074,19 @@ msgid ""
"<code><a cbot|canresearch>canresearch</a> </code>Checks if a technology can be researched\n"
"<code><a cbot|researched>researched</a> </code>Checks if a technology is researched"
msgstr ""
#. type: Plain text
#: ../E/cbot.txt:86
#, no-wrap
msgid ""
"<code><a cbot|class>class</a> </code>Class declararion\n"
"<code><a cbot|public>public</a> </code>Declares a public class member\n"
"<code><a cbot|private>private</a> </code>Declares a private class member\n"
"<code><a cbot|protected>protected</a> </code>Declares a protected class member\n"
"<code><a cbot|static>static</a> </code>Declares a static class member\n"
"<code><a cbot|synchro>synchronized</a> </code>Prevents simultaneous execution\n"
"<code><a cbot|new>new</a> </code>Creates a new instance\n"
"<code><a cbot|this>this</a> </code>Reference to the current instance\n"
"<code><a cbot|extends>extends</a> </code>Extends a class\n"
"<code><a cbot|super>super</a> </code>Grants access to the parent class"
msgstr ""

View File

@ -135,34 +135,14 @@ msgstr ""
msgid "Specific instructions for classes:"
msgstr "Instructions pour les classes:"
#. type: Plain text
#: ../E/cbot.txt:86
#, no-wrap
msgid ""
"<code><a cbot|class>class</a> </code>Class declararion\n"
"<code><a cbot|public>public</a> </code>Declares a public function\n"
"<code><a cbot|private>private</a> </code>Declares a private class member\n"
"<code><a cbot|static>static</a> </code>Declares a static class member\n"
"<code><a cbot|synchro>synchronized</a> </code>Prevents simultaneous execution\n"
"<code><a cbot|new>new</a> </code>Creates a new instance\n"
"<code><a cbot|this>this</a> </code>Reference to the current instance"
msgstr ""
"<code><a cbot|class>class</a> </code>Déclaration d'une classe\n"
"<code><a cbot|public>public</a> </code>Indique une fonction publique\n"
"<code><a cbot|private>private</a> </code>Indique un champ privée dans une classe\n"
"<code><a cbot|static>static</a> </code>Indique un champ statique dans une classe\n"
"<code><a cbot|synchro>synchronized</a> </code>Empêche l'exécution simultanée\n"
"<code><a cbot|new>new</a> </code>Crée une nouvelle instance\n"
"<code><a cbot|this>this</a> </code>Référence l'instance courante"
#. type: \t; header
#: ../E/cbot.txt:94
#: ../E/cbot.txt:97
#, no-wrap
msgid "Specific instructions for strings:"
msgstr "Instructions pour les chaînes de caractères:"
#. type: Plain text
#: ../E/cbot.txt:95
#: ../E/cbot.txt:98
#, no-wrap
msgid ""
"<code><a cbot|strlen>strlen</a> </code>Gets string length\n"
@ -184,13 +164,13 @@ msgstr ""
"<code><a cbot|strlower>strlower</a> </code>Convertit en minuscules."
#. type: \t; header
#: ../E/cbot.txt:104
#: ../E/cbot.txt:107
#, no-wrap
msgid "Specific instructions for files:"
msgstr "Instructions pour les fichiers:"
#. type: Plain text
#: ../E/cbot.txt:105
#: ../E/cbot.txt:108
#, no-wrap
msgid ""
"<code><a cbot|open>open</a> </code>Opens a file\n"
@ -208,13 +188,13 @@ msgstr ""
"<code><a cbot|deletef>deletefile</a> </code>Supprime un fichier"
#. type: \t; header
#: ../E/battles.txt:53 ../E/cbot.txt:128 ../E/freehelp.txt:4
#: ../E/battles.txt:53 ../E/cbot.txt:131 ../E/freehelp.txt:4
#, no-wrap
msgid "See also"
msgstr "Voir aussi"
#. type: Plain text
#: ../E/cbot.txt:129
#: ../E/cbot.txt:132
#, no-wrap
msgid "<a cbot|type>Types</a> and <a cbot|category>categories</a>."
msgstr "<a cbot|type>Types</a> et <a cbot|category>catégories</a>."
@ -692,13 +672,13 @@ msgid ""
msgstr ""
#. type: \t; header
#: ../E/cbot.txt:112
#: ../E/cbot.txt:115
#, no-wrap
msgid "Mathematical functions:"
msgstr "Fonctions mathématiques:"
#. type: Plain text
#: ../E/cbot.txt:113
#: ../E/cbot.txt:116
#, no-wrap
msgid ""
"<code><a cbot|rand>rand</a> </code>Returns a random value\n"
@ -1108,3 +1088,19 @@ msgid ""
"<code><a cbot|canresearch>canresearch</a> </code>Checks if a technology can be researched\n"
"<code><a cbot|researched>researched</a> </code>Checks if a technology is researched"
msgstr ""
#. type: Plain text
#: ../E/cbot.txt:86
#, no-wrap
msgid ""
"<code><a cbot|class>class</a> </code>Class declararion\n"
"<code><a cbot|public>public</a> </code>Declares a public class member\n"
"<code><a cbot|private>private</a> </code>Declares a private class member\n"
"<code><a cbot|protected>protected</a> </code>Declares a protected class member\n"
"<code><a cbot|static>static</a> </code>Declares a static class member\n"
"<code><a cbot|synchro>synchronized</a> </code>Prevents simultaneous execution\n"
"<code><a cbot|new>new</a> </code>Creates a new instance\n"
"<code><a cbot|this>this</a> </code>Reference to the current instance\n"
"<code><a cbot|extends>extends</a> </code>Extends a class\n"
"<code><a cbot|super>super</a> </code>Grants access to the parent class"
msgstr ""

View File

@ -118,27 +118,14 @@ msgstr ""
msgid "Specific instructions for classes:"
msgstr ""
#. type: Plain text
#: ../E/cbot.txt:86
#, no-wrap
msgid ""
"<code><a cbot|class>class</a> </code>Class declararion\n"
"<code><a cbot|public>public</a> </code>Declares a public function\n"
"<code><a cbot|private>private</a> </code>Declares a private class member\n"
"<code><a cbot|static>static</a> </code>Declares a static class member\n"
"<code><a cbot|synchro>synchronized</a> </code>Prevents simultaneous execution\n"
"<code><a cbot|new>new</a> </code>Creates a new instance\n"
"<code><a cbot|this>this</a> </code>Reference to the current instance"
msgstr ""
#. type: \t; header
#: ../E/cbot.txt:94
#: ../E/cbot.txt:97
#, no-wrap
msgid "Specific instructions for strings:"
msgstr ""
#. type: Plain text
#: ../E/cbot.txt:95
#: ../E/cbot.txt:98
#, no-wrap
msgid ""
"<code><a cbot|strlen>strlen</a> </code>Gets string length\n"
@ -152,13 +139,13 @@ msgid ""
msgstr ""
#. type: \t; header
#: ../E/cbot.txt:104
#: ../E/cbot.txt:107
#, no-wrap
msgid "Specific instructions for files:"
msgstr ""
#. type: Plain text
#: ../E/cbot.txt:105
#: ../E/cbot.txt:108
#, no-wrap
msgid ""
"<code><a cbot|open>open</a> </code>Opens a file\n"
@ -170,13 +157,13 @@ msgid ""
msgstr ""
#. type: \t; header
#: ../E/battles.txt:53 ../E/cbot.txt:128 ../E/freehelp.txt:4
#: ../E/battles.txt:53 ../E/cbot.txt:131 ../E/freehelp.txt:4
#, no-wrap
msgid "See also"
msgstr ""
#. type: Plain text
#: ../E/cbot.txt:129
#: ../E/cbot.txt:132
#, no-wrap
msgid "<a cbot|type>Types</a> and <a cbot|category>categories</a>."
msgstr ""
@ -615,13 +602,13 @@ msgid ""
msgstr ""
#. type: \t; header
#: ../E/cbot.txt:112
#: ../E/cbot.txt:115
#, no-wrap
msgid "Mathematical functions:"
msgstr ""
#. type: Plain text
#: ../E/cbot.txt:113
#: ../E/cbot.txt:116
#, no-wrap
msgid ""
"<code><a cbot|rand>rand</a> </code>Returns a random value\n"
@ -1029,3 +1016,19 @@ msgid ""
"<code><a cbot|canresearch>canresearch</a> </code>Checks if a technology can be researched\n"
"<code><a cbot|researched>researched</a> </code>Checks if a technology is researched"
msgstr ""
#. type: Plain text
#: ../E/cbot.txt:86
#, no-wrap
msgid ""
"<code><a cbot|class>class</a> </code>Class declararion\n"
"<code><a cbot|public>public</a> </code>Declares a public class member\n"
"<code><a cbot|private>private</a> </code>Declares a private class member\n"
"<code><a cbot|protected>protected</a> </code>Declares a protected class member\n"
"<code><a cbot|static>static</a> </code>Declares a static class member\n"
"<code><a cbot|synchro>synchronized</a> </code>Prevents simultaneous execution\n"
"<code><a cbot|new>new</a> </code>Creates a new instance\n"
"<code><a cbot|this>this</a> </code>Reference to the current instance\n"
"<code><a cbot|extends>extends</a> </code>Extends a class\n"
"<code><a cbot|super>super</a> </code>Grants access to the parent class"
msgstr ""

View File

@ -138,34 +138,14 @@ msgstr ""
msgid "Specific instructions for classes:"
msgstr "Instrukcje specyficzne dla klas:"
#. type: Plain text
#: ../E/cbot.txt:86
#, no-wrap
msgid ""
"<code><a cbot|class>class</a> </code>Class declararion\n"
"<code><a cbot|public>public</a> </code>Declares a public function\n"
"<code><a cbot|private>private</a> </code>Declares a private class member\n"
"<code><a cbot|static>static</a> </code>Declares a static class member\n"
"<code><a cbot|synchro>synchronized</a> </code>Prevents simultaneous execution\n"
"<code><a cbot|new>new</a> </code>Creates a new instance\n"
"<code><a cbot|this>this</a> </code>Reference to the current instance"
msgstr ""
"<code><a cbot|class>class</a> </code>Deklaracja klasy\n"
"<code><a cbot|public>public</a> </code>Deklaracja funkcji publicznej\n"
"<code><a cbot|private>private</a> </code>Deklaracja prywatnego elementu klasy\n"
"<code><a cbot|static>static</a> </code>Deklaracja statycznego elementu klasy\n"
"<code><a cbot|synchro>synchronized</a> </code>Zapobiega jednoczesnemu wykonywaniu\n"
"<code><a cbot|new>new</a> </code>Tworzy nową instancję\n"
"<code><a cbot|this>this</a> </code>Odwołanie do bieżącej instancji"
#. type: \t; header
#: ../E/cbot.txt:94
#: ../E/cbot.txt:97
#, no-wrap
msgid "Specific instructions for strings:"
msgstr "Instrukcje specyficzne dla łańcuchów:"
#. type: Plain text
#: ../E/cbot.txt:95
#: ../E/cbot.txt:98
#, no-wrap
msgid ""
"<code><a cbot|strlen>strlen</a> </code>Gets string length\n"
@ -187,13 +167,13 @@ msgstr ""
"<code><a cbot|strlower>strlower</a> </code>Zamienia litery na małe"
#. type: \t; header
#: ../E/cbot.txt:104
#: ../E/cbot.txt:107
#, no-wrap
msgid "Specific instructions for files:"
msgstr "Instrukcje specyficzne dla plików:"
#. type: Plain text
#: ../E/cbot.txt:105
#: ../E/cbot.txt:108
#, no-wrap
msgid ""
"<code><a cbot|open>open</a> </code>Opens a file\n"
@ -211,13 +191,13 @@ msgstr ""
"<code><a cbot|deletef>deletefile</a> </code>Usuwa plik"
#. type: \t; header
#: ../E/battles.txt:53 ../E/cbot.txt:128 ../E/freehelp.txt:4
#: ../E/battles.txt:53 ../E/cbot.txt:131 ../E/freehelp.txt:4
#, no-wrap
msgid "See also"
msgstr "Zobacz również"
#. type: Plain text
#: ../E/cbot.txt:129
#: ../E/cbot.txt:132
#, no-wrap
msgid "<a cbot|type>Types</a> and <a cbot|category>categories</a>."
msgstr "<a cbot|type>Typy</a> i <a cbot|category>kategorie</a>."
@ -729,13 +709,13 @@ msgstr ""
"<code><a cbot|busy>busy</a> </code>Sprawdza czy obiekt jest zajęty"
#. type: \t; header
#: ../E/cbot.txt:112
#: ../E/cbot.txt:115
#, no-wrap
msgid "Mathematical functions:"
msgstr "Funkcje matematyczne:"
#. type: Plain text
#: ../E/cbot.txt:113
#: ../E/cbot.txt:116
#, no-wrap
msgid ""
"<code><a cbot|rand>rand</a> </code>Returns a random value\n"
@ -1187,3 +1167,19 @@ msgstr ""
"<code><a cbot|penwidth>penwidth</a> </code>Zmiana grubości pióra\n"
"<code><a cbot|canresearch>canresearch</a> </code>Sprawdza czy można przeprowadzić badanie\n"
"<code><a cbot|researched>researched</a> </code>Sprawdza czy przeprowadzono badanie"
#. type: Plain text
#: ../E/cbot.txt:86
#, no-wrap
msgid ""
"<code><a cbot|class>class</a> </code>Class declararion\n"
"<code><a cbot|public>public</a> </code>Declares a public class member\n"
"<code><a cbot|private>private</a> </code>Declares a private class member\n"
"<code><a cbot|protected>protected</a> </code>Declares a protected class member\n"
"<code><a cbot|static>static</a> </code>Declares a static class member\n"
"<code><a cbot|synchro>synchronized</a> </code>Prevents simultaneous execution\n"
"<code><a cbot|new>new</a> </code>Creates a new instance\n"
"<code><a cbot|this>this</a> </code>Reference to the current instance\n"
"<code><a cbot|extends>extends</a> </code>Extends a class\n"
"<code><a cbot|super>super</a> </code>Grants access to the parent class"
msgstr ""

View File

@ -130,27 +130,14 @@ msgstr ""
msgid "Specific instructions for classes:"
msgstr ""
#. type: Plain text
#: ../E/cbot.txt:86
#, no-wrap
msgid ""
"<code><a cbot|class>class</a> </code>Class declararion\n"
"<code><a cbot|public>public</a> </code>Declares a public function\n"
"<code><a cbot|private>private</a> </code>Declares a private class member\n"
"<code><a cbot|static>static</a> </code>Declares a static class member\n"
"<code><a cbot|synchro>synchronized</a> </code>Prevents simultaneous execution\n"
"<code><a cbot|new>new</a> </code>Creates a new instance\n"
"<code><a cbot|this>this</a> </code>Reference to the current instance"
msgstr ""
#. type: \t; header
#: ../E/cbot.txt:94
#: ../E/cbot.txt:97
#, no-wrap
msgid "Specific instructions for strings:"
msgstr ""
#. type: Plain text
#: ../E/cbot.txt:95
#: ../E/cbot.txt:98
#, no-wrap
msgid ""
"<code><a cbot|strlen>strlen</a> </code>Gets string length\n"
@ -164,13 +151,13 @@ msgid ""
msgstr ""
#. type: \t; header
#: ../E/cbot.txt:104
#: ../E/cbot.txt:107
#, no-wrap
msgid "Specific instructions for files:"
msgstr ""
#. type: Plain text
#: ../E/cbot.txt:105
#: ../E/cbot.txt:108
#, no-wrap
msgid ""
"<code><a cbot|open>open</a> </code>Opens a file\n"
@ -182,13 +169,13 @@ msgid ""
msgstr ""
#. type: \t; header
#: ../E/battles.txt:53 ../E/cbot.txt:128 ../E/freehelp.txt:4
#: ../E/battles.txt:53 ../E/cbot.txt:131 ../E/freehelp.txt:4
#, no-wrap
msgid "See also"
msgstr "См. также"
#. type: Plain text
#: ../E/cbot.txt:129
#: ../E/cbot.txt:132
#, no-wrap
msgid "<a cbot|type>Types</a> and <a cbot|category>categories</a>."
msgstr ""
@ -653,13 +640,13 @@ msgid ""
msgstr ""
#. type: \t; header
#: ../E/cbot.txt:112
#: ../E/cbot.txt:115
#, no-wrap
msgid "Mathematical functions:"
msgstr ""
#. type: Plain text
#: ../E/cbot.txt:113
#: ../E/cbot.txt:116
#, no-wrap
msgid ""
"<code><a cbot|rand>rand</a> </code>Returns a random value\n"
@ -1067,3 +1054,19 @@ msgid ""
"<code><a cbot|canresearch>canresearch</a> </code>Checks if a technology can be researched\n"
"<code><a cbot|researched>researched</a> </code>Checks if a technology is researched"
msgstr ""
#. type: Plain text
#: ../E/cbot.txt:86
#, no-wrap
msgid ""
"<code><a cbot|class>class</a> </code>Class declararion\n"
"<code><a cbot|public>public</a> </code>Declares a public class member\n"
"<code><a cbot|private>private</a> </code>Declares a private class member\n"
"<code><a cbot|protected>protected</a> </code>Declares a protected class member\n"
"<code><a cbot|static>static</a> </code>Declares a static class member\n"
"<code><a cbot|synchro>synchronized</a> </code>Prevents simultaneous execution\n"
"<code><a cbot|new>new</a> </code>Creates a new instance\n"
"<code><a cbot|this>this</a> </code>Reference to the current instance\n"
"<code><a cbot|extends>extends</a> </code>Extends a class\n"
"<code><a cbot|super>super</a> </code>Grants access to the parent class"
msgstr ""

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 B

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 162 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 B

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 300 B

After

Width:  |  Height:  |  Size: 98 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 B

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 B

After

Width:  |  Height:  |  Size: 95 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 B

After

Width:  |  Height:  |  Size: 134 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 B

After

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1000 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 562 KiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 502 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 368 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 814 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 172 KiB