33 lines
750 B
C#
33 lines
750 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
public class Wagon
|
|
{
|
|
Train Train { get; }
|
|
public Stage LogisticDeck { get; } = null;
|
|
public Stage MainDeck { get; private set; } = null;
|
|
List<Stage> UpperDecks { get; } = new List<Stage>();
|
|
|
|
public Wagon(Train train)
|
|
{
|
|
Train = train;
|
|
}
|
|
|
|
public Stage GetDeck(int level)
|
|
{
|
|
if (level < -1 || level > UpperDecks.Count)
|
|
throw new System.ArgumentOutOfRangeException(nameof(level));
|
|
if(level == -1)
|
|
return LogisticDeck;
|
|
if (level == 0)
|
|
return MainDeck;
|
|
|
|
return UpperDecks[level - 1];
|
|
}
|
|
|
|
public void Populate()
|
|
{
|
|
MainDeck = new Stage();
|
|
MainDeck.Populate();
|
|
}
|
|
} |