Guest User

Untitled

a guest
Nov 21st, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.48 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Drawing;
  7.  
  8. namespace ChinczykObiektowo
  9. {
  10.  
  11.     public class Pionek
  12.     {
  13.         public int pozycja;
  14.         public int start;
  15.         public Image Image;
  16.  
  17.         public Pionek(int pozycja, int start, Image image)
  18.         {
  19.             this.pozycja = pozycja;
  20.             this.start = start;
  21.             Image = image;
  22.         }
  23.  
  24.         public Pionek(int pozycja, Image image)
  25.         {
  26.             this.pozycja = pozycja;
  27.             Image = image;
  28.         }
  29.  
  30.         public bool CzyMozliweWyjscie()
  31.         {
  32.             if (Czy6())
  33.             {
  34.                 return true;
  35.             }
  36.             else return false;
  37.         }
  38.  
  39.         public bool CzyJestWBazie()
  40.         {
  41.             if (pozycja == start) return true;
  42.             else return false;
  43.         }
  44.  
  45.         public void RuszSie()
  46.         {
  47.             pozycja += Rzuc();
  48.             if(pozycja > 18)
  49.             {
  50.                 pozycja -= 18;
  51.             }
  52.         }
  53.  
  54.         public bool Czy6()
  55.         {
  56.             if (Rzuc() == 6) return true;
  57.             else return false;
  58.         }
  59.  
  60.         public int Rzuc()
  61.         {
  62.             Random rnd = new Random();
  63.             int wylosowana = rnd.Next(1, 7);
  64.             return wylosowana;
  65.         }
  66.  
  67.         public bool CzyBitwa()
  68.         {
  69.             return true;
  70.         }
  71.  
  72.  
  73.     }
  74. }
Add Comment
Please, Sign In to add comment