-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathItem.cs
More file actions
41 lines (35 loc) · 1000 Bytes
/
Copy pathItem.cs
File metadata and controls
41 lines (35 loc) · 1000 Bytes
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
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
namespace Group1Game
{
class Item : MapObject, ICollectable
{
public string ItemMarker { get; set; }
// public int NumberOfTimesUsed { get; set; }
// public bool IsAvailable { get; set; }
public int X { get; set; }
public int Y { get; set; }
public Item(int length, int height):base(length, height)
{
Length = 1;
Height = 1;
}
public void PlaceFixedItem(Board board)
{
if (board.Boardfield[3, 3] == ".")
{
board.Boardfield[3, 3] = ItemMarker;
}
}
public void PlaceRandomItem(Board board)
{
int a, b;
Random myTal = new Random();
a = myTal.Next(0, board.BoardSize);
b = myTal.Next(0, board.BoardSize);
board.Boardfield[a, b] = ItemMarker;
}
}
}