Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class tablet
- {
- private static int[] res_xx = new int[] { 640, 800, 1024 };
- private static int[] res_yy = new int[] { 480, 600, 768 };
- //
- protected int _res_x;
- protected int _res_y;
- public int res_x
- {
- get { return _res_x; }
- }
- public int res_y
- {
- get { return _res_y; }
- }
- public void setRes(int pResX, int pResY)
- {
- int i = Array.IndexOf(res_xx, pResX);
- int j = Array.IndexOf(res_yy, pResY);
- if (i == -1 || j == -1) throw new Exception("nincs ilyen felb");
- if (i != j) throw new Exception("nem parban allithato");
- _res_x = pResX;
- _res_y = pResY;
- }
- //
- private static double[] verziok = new double[] { 4.0, 4.1, 4.2 };
- protected double _android_ver;
- public double android_ver
- {
- get { return _android_ver; }
- set
- {
- int i = Array.IndexOf(verziok, value);
- if (i == -1) throw new Exception("nincs ilyen verzio");
- _android_ver = value;
- }
- }
- //
- public bool camera;
- public bool gps;
- //
- protected int _cost;
- public int cost
- {
- get { return _cost; }
- set
- {
- if (value < 10000 || value > 800000) throw new Exception("nem jo ar");
- _cost = value;
- }
- }
- //
- public tablet(int pResX, int pResY, double ver, bool pCam, bool pGps, int pCost)
- {
- setRes(pResX, pResY);
- android_ver = ver;
- camera = pCam;
- gps = pGps;
- cost = pCost;
- }
- public tablet(int pResX, int pResY, double ver, int pCost)
- : this(pResX, pResY, ver, false, false, pCost)
- {
- }
- public tablet(int pCost)
- : this(res_xx[0], res_yy[0], verziok[0], false, false, pCost)
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement