Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Drawing;
- namespace ChinczykObiektowo
- {
- public class Pionek
- {
- public int pozycja;
- public int start;
- public Image Image;
- public Pionek(int pozycja, int start, Image image)
- {
- this.pozycja = pozycja;
- this.start = start;
- Image = image;
- }
- public Pionek(int pozycja, Image image)
- {
- this.pozycja = pozycja;
- Image = image;
- }
- public bool CzyMozliweWyjscie()
- {
- if (Czy6())
- {
- return true;
- }
- else return false;
- }
- public bool CzyJestWBazie()
- {
- if (pozycja == start) return true;
- else return false;
- }
- public void RuszSie()
- {
- pozycja += Rzuc();
- if(pozycja > 18)
- {
- pozycja -= 18;
- }
- }
- public bool Czy6()
- {
- if (Rzuc() == 6) return true;
- else return false;
- }
- public int Rzuc()
- {
- Random rnd = new Random();
- int wylosowana = rnd.Next(1, 7);
- return wylosowana;
- }
- public bool CzyBitwa()
- {
- return true;
- }
- }
- }
Add Comment
Please, Sign In to add comment