-
Notifications
You must be signed in to change notification settings - Fork 0
/
SpriteProvider.cs
39 lines (31 loc) · 1.05 KB
/
SpriteProvider.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
using IADames.Properties;
using System;
using System.Collections.Generic;
using System.Drawing;
namespace IADames
{
class SpriteProvider
{
public Image PionN { get; private set; }
public Image PionB { get; private set; }
public Image DameN { get; private set; }
public Image DameB { get; private set; }
private SpriteProvider()
{
Bitmap modele = new Bitmap(Resources.DamesPiecesArray);
DameN = modele.Clone(new Rectangle(50, 50, 50, 50), modele.PixelFormat);
DameB = modele.Clone(new Rectangle(50, 0, 50, 50), modele.PixelFormat);
PionN = modele.Clone(new Rectangle(0, 50, 50, 50), modele.PixelFormat);
PionB = modele.Clone(new Rectangle(0, 0, 50, 50), modele.PixelFormat);
}
private static SpriteProvider instance;
public static SpriteProvider Instance
{
get
{
if (instance == null) instance = new SpriteProvider();
return instance;
}
}
}
}