summaryrefslogtreecommitdiff
path: root/script-editor/Pointer.cs
blob: 24aa7d9a379bc9788ea27211f8057b438cf36dcd (plain)
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
using System.Xml.Serialization;

namespace VPScriptEditor
{
    public enum PointerState { Undefined, Unsure, Done };

    public class PointerAnnotation
    {
        [XmlElement("State")]
        public PointerState state;
        [XmlElement("Comment")]
        public string comment;

        public PointerAnnotation() : this(PointerState.Undefined, null) { }
        
        public PointerAnnotation(PointerState state, string comment)
        {
            this.state = state;
            this.comment = comment;
        }
    }

    public enum WindowType { Normal, Fixed, None };

    public class Pointer
    {
        public string rooms, x, y, width, height, content;
        public WindowType type;

        public Pointer(string rooms, WindowType type, string x, string y, string width, string height, string content)
        {
            setVars(rooms, type, x, y, width, height, content);
        }

        public void copyFrom(Pointer p)
        {
            setVars(p.rooms, p.type, p.x, p.y, p.width, p.height, p.content);
        }

        public void setVars(string rooms, WindowType type, string x, string y, string width, string height, string content)
        {
            this.rooms = rooms;
            this.type = type;

            if (type == WindowType.Normal)
            {
                this.x = x;
                this.y = y;
                this.width = width;
                this.height = height;
            }
            else
                this.x = this.y = this.width = this.height = null;

            this.content = content;
        }
    }
}