private static void FillTable(string[] content) { PuppetModel[,] puppets = SingletonPuppets.instance.Value.GetInstance(); PuppetModel.SimpleOrDama type; PuppetModel.Colour colour; for (int i = 0; i < content.Length - 1; i++) { string[] element = content[i].Split(' '); colour = element[0].Trim() == Constants.red ? PuppetModel.Colour.Red : PuppetModel.Colour.Blue; type = element[1].Trim() == Constants.simple ? PuppetModel.SimpleOrDama.Simple : PuppetModel.SimpleOrDama.Dama; int x = Convert.ToInt32(element[2]); int y = Convert.ToInt32(element[3]); puppets[x, y] = new PuppetModel(colour, type); } }
public void DisplayField(PuppetModel puppet) { if (puppet != null) { Console.Write(Constants.I); if (puppet.Color == PuppetModel.Colour.Blue) { Console.ForegroundColor = ConsoleColor.Blue; } else { Console.ForegroundColor = ConsoleColor.Red; } Console.Write("{0}", puppet.Typ == PuppetModel.SimpleOrDama.Simple ? Constants.X : Constants.Y); Console.ForegroundColor = ConsoleColor.White; } else { Console.Write(Constants.ISpace); } }
public void DisplayField(PuppetModel puppet) { throw new NotImplementedException(); }