-
Notifications
You must be signed in to change notification settings - Fork 0
/
Brush.cs
42 lines (37 loc) · 893 Bytes
/
Brush.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Xml;
namespace AlienGame
{
class Brush
{
public Rectangle Bounds;
public int Content;
public Brush(Rectangle bounds)
{
Bounds = bounds;
}
public void Save(XmlWriter w)
{
w.WriteStartElement("brush");
w.WriteAttribute("left", Bounds.Left);
w.WriteAttribute("top", Bounds.Top);
w.WriteAttribute("right", Bounds.Right);
w.WriteAttribute("bottom", Bounds.Bottom);
w.WriteAttribute("content", Content);
w.WriteEndElement();
}
public Brush(XmlElement e)
{
Bounds = Rectangle.FromLTRB(
e.GetAttributeInt("left", 0),
e.GetAttributeInt("top", 0),
e.GetAttributeInt("right", 0),
e.GetAttributeInt("bottom", 0));
Content = e.GetAttributeInt("content", 0);
}
}
}