Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
24
Task/Inheritance-Multiple/Elena/inheritance-multiple-1.elena
Normal file
24
Task/Inheritance-Multiple/Elena/inheritance-multiple-1.elena
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
singleton CameraFeature
|
||||
{
|
||||
cameraMsg
|
||||
= "camera";
|
||||
}
|
||||
|
||||
class MobilePhone
|
||||
{
|
||||
mobileMsg
|
||||
= "phone";
|
||||
}
|
||||
|
||||
class CameraPhone : MobilePhone
|
||||
{
|
||||
dispatch() => CameraFeature;
|
||||
}
|
||||
|
||||
public program()
|
||||
{
|
||||
var cp := new CameraPhone();
|
||||
|
||||
console.writeLine(cp.cameraMsg);
|
||||
console.writeLine(cp.mobileMsg)
|
||||
}
|
||||
26
Task/Inheritance-Multiple/Elena/inheritance-multiple-2.elena
Normal file
26
Task/Inheritance-Multiple/Elena/inheritance-multiple-2.elena
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import system'dynamic;
|
||||
|
||||
class CameraFeature
|
||||
{
|
||||
cameraMsg
|
||||
= "camera";
|
||||
}
|
||||
|
||||
class MobilePhone
|
||||
{
|
||||
mobileMsg
|
||||
= "phone";
|
||||
}
|
||||
|
||||
singleton CameraPhone
|
||||
{
|
||||
new() = new MobilePhone().mixInto(new CameraFeature());
|
||||
}
|
||||
|
||||
public program()
|
||||
{
|
||||
var cp := CameraPhone.new();
|
||||
|
||||
console.writeLine(cp.cameraMsg);
|
||||
console.writeLine(cp.mobileMsg)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue