aboutsummaryrefslogtreecommitdiff
path: root/V3/Data/GameState.cs
blob: b38ec465a96e97fd95209b86b5957b80f006972c (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
59
60
61
62
63
64
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using V3.AI;
using V3.Objects;

namespace V3.Data
{
    /// <summary>
    /// Stores the current state of the game (the data that must be stored in
    /// a save game).  All members should be public and serializable.
    /// </summary>
    [Serializable]
    public sealed class GameState
    {
        public List<CreatureData> mCreatures = new List<CreatureData>();
        public List<Rectangle> mFog = new List<Rectangle>();
        public Vector2 mCameraPosition;
        public AiState mAiState = AiState.Idle;
    }

    public enum CreatureType
    {
        FemalePeasant,
        King,
        KingsGuard,
        Knight,
        MalePeasant,
        Meatball,
        Necromancer,
        Prince,
        Skeleton,
        SkeletonHorse,
        Zombie
    }

    public sealed class CreatureData
    {
        public CreatureType Type { get; set; }
        public int Id { get; set; }
        public int Life { get; set; }
        public int MaxLife { get; set; }
        public int Attack { get; set; }
        public TimeSpan Recovery { get; set; }
        public bool IsUpgraded { get; set; }
        public float PositionX { get; set; }
        public float PositionY { get; set; }
        public MovementDirection MovementDirection { get; set; }
        public MovementState MovementState { get; set; }
        public MovementData MovementData { get; set; }
        public int IsAttackingId { get; set; }
        public bool Mounted { get; set; }
        public int SkeletonId { get; set; }
        // IsAttackingBuilding
    }

    public sealed class MovementData
    {
        public List<Vector2> Path { get; set; }
        public int Step { get; set; }
        public Vector2 LastMovement { get; set; }
        public bool IsMoving { get; set; }
    }
}