-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSharedVariables.cs
106 lines (99 loc) · 2.11 KB
/
SharedVariables.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace SimFarm
{
class SharedVariables
{
public SharedVariables(int rows, int cols)
{
NumRows = rows;
NumCols = cols;
_grid = new Product[NumCols, NumRows];
}
//grid size - number of rows and columns
private int _numRows;
public int NumRows
{
get
{
return _numRows;
}
set
{
_numRows = value;
}
}
public int _numCols;
public int NumCols
{
get
{
return _numCols;
}
set
{
_numCols = value;
}
}
//stores the amount of money the user has
private double _money = 100000;
public double Money
{
get
{
return _money;
}
set
{
_money = value;
}
}
//stores the amount of revenue the user makes
private double _revenue = 0;
public double Revenue
{
get
{
return _revenue;
}
set
{
_revenue = value;
}
}
//stores the grid
private Product[,] _grid;
public Product[,] Grid
{
get
{
return _grid;
}
set
{
_grid = value;
}
}
//stores the age of the farm
private int _ageOfFarm = 0;
public int AgeOfFarm
{
get
{
return _ageOfFarm;
}
set
{
_ageOfFarm = value;
}
}
//creates a random number
Random numberGenerator = new Random();
}
}