Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace visual3
- {
- class Program
- {
- static void Main(string[] args)
- {
- Postac krzys = new Postac(25.17, -4.87, "krzys");
- Console.WriteLine("Imie {0}", krzys.Imie);
- krzys.Imie = "test";
- Console.WriteLine("Imie {0}", krzys.Imie);
- }
- }
- class Object {
- private double pozycjaX;
- private double pozycjaY;
- public Object(double x, double y){
- this.pozycjaX = x;
- this.pozycjaY = y;
- }
- public virtual void Rysuj(int styl){}
- public void setPozycjaX(double x){
- this.pozycjaX = x;
- }
- public void setPozycjay(double y){
- this.pozycjaY = y;
- }
- public double getPozycjaX(){
- return this.pozycjaX;
- }
- public double getPozycjaY(){
- return this.pozycjaY;
- }
- }
- class Animacja : Object{
- private int liczbaCykli;
- private int czasCyklu;
- public Animacja(double pozycjaX, double pozycjaY): base(pozycjaX, pozycjaY){
- liczbaCykli = 0;
- czasCyklu = 0;
- }
- override public void Rysuj(int styl){
- }
- public void setLiczbaCykli(int c){
- this.liczbaCykli = c;
- }
- public int getLiczbaCykli(){
- return liczbaCykli;
- }
- public int getCzasCyklu(){
- return czasCyklu;
- }
- }
- class Postac : Animacja{
- private string imie;
- public Postac(double pozycjaX, double pozycjaY, string imie):base(pozycjaX, pozycjaY){
- this.imie = imie;
- }
- override public void Rysuj(int styl){
- }
- public string Imie {
- get { return imie;}
- set { imie = value;}
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement