Ejemplo n.º 1
0
 public FormController(IView theView, Game theGame, FileHandler thefiler, LevelBuilder thebuilder)
 {
     view = theView;
     game = theGame;
     filer = thefiler;
     builder = thebuilder;
 }
Ejemplo n.º 2
0
        public Controller(IView theView, Game theGame, FileHandler theFiler, LevelBuilder theBuilder)
        {
            view    = theView;
            game    = theGame;
            filer   = theFiler;
            builder = theBuilder;

            filer.Init();
            game.Init(view, filer);
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            LevelBuilder builder = new LevelBuilder();

            builder.Init(new Point(3, 3));
            builder.SelectTile(new Point(0, 2));

            //builder.SetMinotaur();

            Console.WriteLine(builder.SetMinotaur());
            Console.WriteLine(builder.SetTheseus());
            Console.WriteLine(builder.Exit());


            Console.ReadKey();
        }
Ejemplo n.º 4
0
        public void LoadUserMap(AMap theMap)
        {
            builder = new LevelBuilder();
            mediaPath = @"H:\2015\semester 2\PR 283 C#\Theseus\TheseusFormed - Test\media";
            builder.LoadUserMap(theMap);

            tbxMapName.Text = theMap.Name;
            //Painter.SetPanelSize(
            //SetPanelSize();
            Draw();
            //RenderCharacters();
        }
Ejemplo n.º 5
0
 public void Init(Point dimensions)
 {
     builder = new LevelBuilder();
     builder.Init(dimensions);
     //Painter.SetMediaPath(@"H:\2015\semester 2\PR 283 C#\Theseus\TheseusFormed - Test\media");
     mediaPath = @"H:\2015\semester 2\PR 283 C#\Theseus\TheseusFormed - Test\media";
     //SetPanelSize();
     Draw();
 }
Ejemplo n.º 6
0
        static void Main(string[] args)
        {
            /*Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form_Splash());*/
            //new Controller(new ConsoleView(), new Game(), new FileHandler(), new LevelBuilder()).Init();

            FileHandler filer = new FileHandler();
            LevelBuilder builder = new LevelBuilder();
            /*Game theGame = new Game();
            filer.Init();
            filer.SetMap(0, "Map 1.");

            theGame.SetFiler(filer);
            theGame.SetMap();

            foreach (Tile tile in theGame.GetMap())
            {
                Console.WriteLine(tile.Coordinate);
            }

            Tile theTile = theGame.GetMap()[3, 2];
            Console.WriteLine(theTile.Coordinate);
            Console.WriteLine(theGame.GetMap().GetLength(0));
            Console.WriteLine(theTile.IsOuter(Direction.Left));

            int i = 105;

            Console.WriteLine(i / 50);*/
            /*
            Point p = new Point(4, 4);
            builder.Init(p);
            p = new Point(3, 0);
            builder.SelectTile(p);
            builder.Exit();
            builder.EastWall();

            p = new Point(0, 3);
            builder.SelectTile(p);
            builder.SetTheseus();
            p = new Point(0, 2);
            builder.SelectTile(p);
            builder.SetMinotaur();

            Console.WriteLine(builder.Test());

            builder.Clear();

            Console.WriteLine(builder.Test());

            /*filer.Init();
            filer.SetMap(0, "Map 6");
            filer.GetNextMap();*/

            //Console.WriteLine(MapCreator.ObjectsToString(filer.GetMap().Tiles, filer.GetMap().TheTheseus, filer.GetMap().TheMinotaur));
            Loader loader = new Loader();
            Compressor compressor = new Compressor();
            Decompressor decompressor;

            /*string str = filer.LoadTextFile(@"H:\2015\semester 2\PR 283 C#\Theseus\level1.txt");
            Console.WriteLine(str);

            string[] stra = loader.ToStringArray(str);
            compressor.LoadMap(stra);
            compressor.FindSpecialCharacters();
            compressor.CompressLevel1();
            compressor.SetTheResult();
            Console.WriteLine(compressor.GetLvl1());
            Saver saver = new Saver();
            saver.SetFileName("lvl1c1");
            saver.SaveSingle(@"H:\2015\semester 2\PR 283 C#\Theseus", compressor.GetLvl1());*/

            string newFile = filer.LoadTextFile(@"H:\2015\semester 2\PR 283 C#\Theseus\lvl1c1.txt");
            decompressor = new Decompressor();

            decompressor.SetCompressed(newFile);

            //try
            //{
                decompressor.SeparateToArrays();
            //}

                decompressor.DecompressLevel1();
                decompressor.SetCharacters();

            /*int x = 0;
            foreach (string st in stra)
            {
                Console.WriteLine(x.ToString() + st);
                Console.WriteLine(st.Length);
                x++;
            }

            Bridger bridger = new Bridger();

            AMap newMap = new AMap();
            newMap.Map = stra;

            newMap = bridger.Convert(newMap);

            Console.WriteLine(newMap.TheMinotaur.Coordinate);
            Console.WriteLine(newMap.TheTheseus.Coordinate);*/

            //filer.IsValid(@"H:\2015\semester 2\PR 283 C#\Theseus\level1.txt");

            Console.ReadKey();
        }
Ejemplo n.º 7
0
        static void Main(string[] args)
        {
            LevelBuilder builder = new LevelBuilder();

            builder.Init(new Point(3, 3));
            builder.SelectTile(new Point(0, 2));

            //builder.SetMinotaur();

            Console.WriteLine(builder.SetMinotaur());
            Console.WriteLine(builder.SetTheseus());
            Console.WriteLine(builder.Exit());

            Console.ReadKey();
        }
Ejemplo n.º 8
0
        public Controller(IView theView, Game theGame, FileHandler theFiler, LevelBuilder theBuilder)
        {
            view = theView;
            game = theGame;
            filer = theFiler;
            builder = theBuilder;

            filer.Init();
            game.Init(view, filer);
        }
Ejemplo n.º 9
0
        public void LoadUserMap(AMap theMap)
        {
            builder = new LevelBuilder();
            mediaPath = Painter.SetMediaPath();
            builder.LoadUserMap(theMap);

            tbxMapName.Text = theMap.Name;
            //Painter.SetPanelSize(
            //SetPanelSize();
            Draw();
            //RenderCharacters();
        }