source: 2014/30/MiskaK/The Reclaim/The Reclaim/The Reclaim/The Reclaim/LevelData.cs @ 5689

Revision 5649, 1.7 KB checked in by anlakane, 6 years ago (diff)
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using Jypeli;
6
7public class LevelData
8{
9    public Image GroundTexture { get; private set; }
10
11    /// <summary>
12    /// Ruutukartta, jonka mukaan seinät sijoitetaan.
13    /// </summary>
14    public Image Walls { get; private set; }
15
16    /// <summary>
17    /// Ruutukartta, jonka mukaan katot ja muut korkealla olevat esineet sijoitetaan.
18    /// </summary>
19    public Image Roofs { get; private set; }
20
21    public List<Entrance> Entrances { get; set; }
22
23    public Vector ExitPoint { get; set; }
24
25    /// <summary>
26    /// Leveimmän kartan leveys.
27    /// </summary>
28    public int Width
29    {
30        get { return Widest(); }
31    }
32
33    /// <summary>
34    /// Korkeimman kartan korkeus.
35    /// </summary>
36    public int Height
37    {
38        get { return Highest(); }
39    }
40
41    public LevelData(string groundTexture, string wallImage, string roofImage)
42    {
43        Walls = The_Reclaim.LoadImage(wallImage);
44        Roofs = The_Reclaim.LoadImage(roofImage);
45        GroundTexture = The_Reclaim.LoadImage(groundTexture);
46        Entrances = new List<Entrance>();
47    }
48
49    public LevelData(Image groundTexture, Image wallImage, Image roofImage)
50    {
51        Walls = wallImage;
52        Roofs = roofImage;
53        GroundTexture = groundTexture;
54        Entrances = new List<Entrance>();
55    }
56
57    private int Widest()
58    {
59        int widest = Walls.Width;
60        if (Roofs.Width > widest)
61            widest = Roofs.Width;
62        return widest;
63    }
64
65    private int Highest()
66    {
67        int highest = Walls.Height;
68        if (Roofs.Height > highest)
69            highest = Roofs.Height;
70        return highest;
71    }
72}
Note: See TracBrowser for help on using the repository browser.