using System.Collections.Generic;
using System.Xml;

namespace TeslaConsole.RedPlanet;

public class FootballScenario : Scenario
{
	private Dictionary<string, RPTeam> mTeams = new Dictionary<string, RPTeam>();

	private Dictionary<string, string> mPositions = new Dictionary<string, string>();

	public Dictionary<string, RPTeam> Teams => mTeams;

	public Dictionary<string, string> Positions => mPositions;

	internal FootballScenario(XmlNode scenarioNode)
		: base(scenarioNode)
	{
		foreach (XmlNode childNode in scenarioNode.ChildNodes)
		{
			switch (childNode.Name)
			{
			case "position":
				RPConfig.AddKeyNameNode(childNode, mPositions);
				break;
			case "team":
			{
				RPTeam rPTeam = new RPTeam(childNode);
				mTeams.Add(rPTeam.Key, rPTeam);
				break;
			}
			}
		}
	}
}
