コード例 #1
0
ファイル: LaserFactory.cs プロジェクト: shanks7796/LaserMaze
        public Laser BuildLaser(string laserDef)
        {
            Match location         = _locationRegex.Match(laserDef);
            Match orientationMatch = _orientationRegex.Match(laserDef);

            int xLoc = Convert.ToInt32(location.Groups[0].Value.Substring(0, 1));
            int yLoc = Convert.ToInt32(location.Groups[0].Value.Substring(2, 1));

            LaserOrientation orientation = GetOrientation(orientationMatch.Groups[0].Value.Substring(0, 1));

            return(new Laser(xLoc, yLoc, orientation));
        }
コード例 #2
0
ファイル: Maze.cs プロジェクト: timboeschen/MazeLaser
 public Maze(int width, int height, Room entryRoom, LaserOrientation lazerOrientation) : this(width, height)
 {
     EntryRoom        = entryRoom;
     LazerOrientation = lazerOrientation;
 }