tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
59
Task/Polymorphism/PureBasic/polymorphism-1.purebasic
Normal file
59
Task/Polymorphism/PureBasic/polymorphism-1.purebasic
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
Class MyPoint
|
||||
|
||||
BeginProtect
|
||||
x.i
|
||||
y.i
|
||||
EndProtect
|
||||
|
||||
Public Method GetX()
|
||||
MethodReturn This\X
|
||||
EndMethod
|
||||
|
||||
Public Method GetY()
|
||||
MethodReturn This\Y
|
||||
EndMethod
|
||||
|
||||
Public Method SetX(n)
|
||||
This\X=n
|
||||
EndMethod
|
||||
|
||||
Public Method SetY(n)
|
||||
This\Y=n
|
||||
EndMethod
|
||||
|
||||
Public Method Print()
|
||||
PrintN("Point")
|
||||
EndMethod
|
||||
|
||||
Public Method Init(x=0,y=0)
|
||||
This\x=x
|
||||
This\y=y
|
||||
EndMethod
|
||||
EndClass
|
||||
|
||||
Class Circle Extends MyPoint
|
||||
|
||||
Protect Radie.i
|
||||
|
||||
Public Method Circel(x=0, y=0, r=0)
|
||||
This\X = x
|
||||
This\y = y
|
||||
This\Radie=r
|
||||
EndMethod
|
||||
|
||||
Public Method GetRadie()
|
||||
MethodReturn This\Radie
|
||||
EndMethod
|
||||
|
||||
Public Method SetRadie(n)
|
||||
This\Radie = n
|
||||
EndMethod
|
||||
|
||||
Public Method Print()
|
||||
PrintN("Circle: "+ _
|
||||
" X= "+Str(This\X)+ _
|
||||
" Y= "+Str(This\Y)+ _
|
||||
" R= "+Str(This\Radie))
|
||||
EndMethod
|
||||
|
||||
EndClass
|
||||
Loading…
Add table
Add a link
Reference in a new issue