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

Revision 5515, 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    /// <summary>
24    /// Leveimmän kartan leveys.
25    /// </summary>
26    public int Width
27    {
28        get { return Widest(); }
29    }
30
31    /// <summary>
32    /// Korkeimman kartan korkeus.
33    /// </summary>
34    public int Height
35    {
36        get { return Highest(); }
37    }
38
39    public LevelData(string groundTexture, string wallImage, string roofImage)
40    {
41        Walls = The_Reclaim.LoadImage(wallImage);
42        Roofs = The_Reclaim.LoadImage(roofImage);
43        GroundTexture = The_Reclaim.LoadImage(groundTexture);
44        Entrances = new List<Entrance>();
45    }
46
47    public LevelData(Image groundTexture, Image wallImage, Image roofImage)
48    {
49        Walls = wallImage;
50        Roofs = roofImage;
51        GroundTexture = groundTexture;
52        Entrances = new List<Entrance>();
53    }
54
55    private int Widest()
56    {
57        int widest = Walls.Width;
58        if (Roofs.Width > widest)
59            widest = Roofs.Width;
60        return widest;
61    }
62
63    private int Highest()
64    {
65        int highest = Walls.Height;
66        if (Roofs.Height > highest)
67            highest = Roofs.Height;
68        return highest;
69    }
70}
Note: See TracBrowser for help on using the repository browser.