mirror of
https://github.com/Ed94/LangStudies.git
synced 2024-11-10 04:14:53 -08:00
BAPFS Lecture 17
This commit is contained in:
parent
83b0ee2974
commit
8ad16eb886
32
Builds/Tests/14.Classes.uf
Normal file
32
Builds/Tests/14.Classes.uf
Normal file
@ -0,0 +1,32 @@
|
||||
class Point
|
||||
{
|
||||
def constructor(x, y)
|
||||
{
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
def sum()
|
||||
{
|
||||
return this.x + this.y;
|
||||
}
|
||||
}
|
||||
|
||||
class Point3D extends Point
|
||||
{
|
||||
def constructor(x, y, z)
|
||||
{
|
||||
super(x, y);
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
def sum()
|
||||
{
|
||||
return super() + this.z;
|
||||
}
|
||||
}
|
||||
|
||||
let
|
||||
point = new Point(10, 20, 30);
|
||||
point.sum();
|
||||
|
1365
Editor/Lectures/Lecture.17.gd
Normal file
1365
Editor/Lectures/Lecture.17.gd
Normal file
File diff suppressed because it is too large
Load Diff
@ -18,7 +18,7 @@ config/icon="res://Assets/Branding/RDP_Class_cover_small.png"
|
||||
[autoload]
|
||||
|
||||
GScene="*res://Lectures/Lecture.tscn"
|
||||
GScript="*res://Lectures/Lecture.16.gd"
|
||||
GScript="*res://Lectures/Lecture.17.gd"
|
||||
|
||||
[gui]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user