protected void SetCharacters(int theMap) { switch (theMap) { case 1: minotaur = SetMinotaur(1, 0); theseus = SetTheseus(1, 2); break; case 2: theseus = SetTheseus(2, 1); minotaur = SetMinotaur(0, 1); break; case 3: theseus = SetTheseus(1, 1); minotaur = SetMinotaur(1, 0); break; case 4: theseus = SetTheseus(1, 1); minotaur = SetMinotaur(4, 2); break; case 5: theseus = SetTheseus(2, 1); minotaur = SetMinotaur(2, 4); break; case 6: theseus = SetTheseus(0, 1); minotaur = SetMinotaur(4, 3); break; case 7: theseus = SetTheseus(4, 5); minotaur = SetMinotaur(0, 5); break; default: break; } }
protected void SetMinotaur(Minotaur newMinotaur) { minotaur = newMinotaur; minotaur.SetGame(this); }
protected Minotaur SetMinotaur(int newX, int newY) { minotaur = new Minotaur(newX, newY); return(minotaur); }
public void SetMinotaur() { int x = theTile.Coordinate.X; int y = theTile.Coordinate.Y; if ((Object)minotaur == null) { minotaur = new Minotaur(x, y); } // catch: theseus on same tile }
protected Minotaur SetMinotaur(int newX, int newY) { minotaur = new Minotaur(newX, newY); return minotaur; }
internal static String ObjectsToString(Tile[,] theMap, Theseus theTheseus, Minotaur theMinotaur) { string output = ""; int width = theMap.GetLength(0); int height = theMap.GetLength(1); for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { output += "."; if (theMap[x, y].MyWalls.HasFlag(TheWalls.North)) { output += "___"; } else { output += " "; } } output += ".\n"; for (int x = 0; x < width; x++) { if (x != width - 1) { if (theMap[x, y].MyWalls.HasFlag(TheWalls.West) && !theMap[x, y].MyWalls.HasFlag(TheWalls.End)) { output += "| "; } if (!theMap[x, y].MyWalls.HasFlag(TheWalls.West) && !theMap[x, y].MyWalls.HasFlag(TheWalls.End)) { output += " "; } if (theMap[x, y].MyWalls.HasFlag(TheWalls.West) && !theMap[x, y].MyWalls.HasFlag(TheWalls.East) && theMap[x, y].MyWalls.HasFlag(TheWalls.End)) { output += "| X "; } if (theMap[x, y].MyWalls.HasFlag(TheWalls.West) && theMap[x, y].MyWalls.HasFlag(TheWalls.East) && theMap[x, y].MyWalls.HasFlag(TheWalls.End)) { output += "| X "; } if (!theMap[x, y].MyWalls.HasFlag(TheWalls.West) && theMap[x, y].MyWalls.HasFlag(TheWalls.East) && theMap[x, y].MyWalls.HasFlag(TheWalls.End)) { output += " X "; } if (!theMap[x, y].MyWalls.HasFlag(TheWalls.West) && !theMap[x, y].MyWalls.HasFlag(TheWalls.East) && theMap[x, y].MyWalls.HasFlag(TheWalls.End)) { output += " X "; } } if (x == width - 1) { if (theMap[x, y].MyWalls.HasFlag(TheWalls.West) && !theMap[x, y].MyWalls.HasFlag(TheWalls.East) && !theMap[x, y].MyWalls.HasFlag(TheWalls.End)) { output += "| "; } if (theMap[x, y].MyWalls.HasFlag(TheWalls.West) && theMap[x, y].MyWalls.HasFlag(TheWalls.East) && !theMap[x, y].MyWalls.HasFlag(TheWalls.End)) { output += "| |"; } if (!theMap[x, y].MyWalls.HasFlag(TheWalls.West) && theMap[x, y].MyWalls.HasFlag(TheWalls.East) && !theMap[x, y].MyWalls.HasFlag(TheWalls.End)) { output += " |"; } if (!theMap[x, y].MyWalls.HasFlag(TheWalls.West) && !theMap[x, y].MyWalls.HasFlag(TheWalls.East) && !theMap[x, y].MyWalls.HasFlag(TheWalls.End)) { output += " "; } if (theMap[x, y].MyWalls.HasFlag(TheWalls.West) && !theMap[x, y].MyWalls.HasFlag(TheWalls.East) && theMap[x, y].MyWalls.HasFlag(TheWalls.End)) { output += "| X "; } if (theMap[x, y].MyWalls.HasFlag(TheWalls.West) && theMap[x, y].MyWalls.HasFlag(TheWalls.East) && theMap[x, y].MyWalls.HasFlag(TheWalls.End)) { output += "| X "; } if (!theMap[x, y].MyWalls.HasFlag(TheWalls.West) && theMap[x, y].MyWalls.HasFlag(TheWalls.East) && theMap[x, y].MyWalls.HasFlag(TheWalls.End)) { output += " X "; } if (!theMap[x, y].MyWalls.HasFlag(TheWalls.West) && !theMap[x, y].MyWalls.HasFlag(TheWalls.East) && theMap[x, y].MyWalls.HasFlag(TheWalls.End)) { output += " X "; } } if (x == theMinotaur.Coordinate.X && y == theMinotaur.Coordinate.Y) { StringBuilder minoPosition = new StringBuilder(output); minoPosition[output.Length - 2] = 'M'; output = minoPosition.ToString(); } if (x == theTheseus.Coordinate.X && y == theTheseus.Coordinate.Y) { StringBuilder thesPosition = new StringBuilder(output); thesPosition[output.Length - 2] = 'T'; output = thesPosition.ToString(); } } output += "\n"; } // lowest row of map for (int x = 0; x < width; x++) { output += "."; if (theMap[x, height - 1].MyWalls.HasFlag(TheWalls.South)) { output += "___"; } else { output += " "; } } output += "."; return output; }
protected void SetMinotaur(int newX, int newY) { minotaur = new Minotaur(newX, newY); }