예제 #1
0
        public MainWindow()
        {
            hero1 = new Hero(new SimpleSquareCoordinate(1, 1, 0));
            hero1.SetOwnerID(1);
            hero2 = new Hero(new SimpleSquareCoordinate(10, 10, 0));
            hero2.SetOwnerID(2);

            choosen = hero1;

            model = new ModelDemo3(MapType.Square, 100, 100);
            model.SetMap(MapType.Square, 100, 100);
            var temp1 = new ResourceSet(new SimpleSquareCoordinate(1, 1, 1));

            model.AddResourceType("Gold");
            model.AddResourceType("Stone");
            model.AddPlayer();
            model.AddResourceType("Sera");
            model.AddPlayer();
            model.AddObject(hero1);
            model.AddObject(hero2);

            model.AddObjectType(typeof(IOwnable));
            model.AddObjectType(typeof(ICollectable));
            model.AddObjectType(typeof(IMobile));
            model.AddObjectType(typeof(IWall));

            var    Temp1 = new ResourceSet(new SimpleSquareCoordinate(5, 5, 5));
            var    Temp2 = new ResourceSet(new SimpleSquareCoordinate(7, 3, 5));
            var    Temp3 = new ResourceSet(new SimpleSquareCoordinate(7, 5, 5));
            var    Temp4 = new WallDemo(new SimpleSquareCoordinate(0, 3, 5));
            var    Temp5 = new WallDemo(new SimpleSquareCoordinate(3, 0, 5));
            var    Temp6 = new WallDemo(new SimpleSquareCoordinate(3, 3, 5));
            Shahta sh    = new Shahta(new SimpleSquareCoordinate(9, 9, 0));

            Temp1.AddResource("Gold", 100);
            Temp1.AddResource("Sera", 4);
            Temp1.AddResource("Stone", 15);

            Temp2.AddResource("Gold", 123);
            Temp2.AddResource("Sera", 0);
            Temp2.AddResource("Stone", 2);

            Temp3.AddResource("Gold", 98);
            Temp3.AddResource("Sera", 12);
            Temp3.AddResource("Stone", 11);

            model.AddObject(Temp1);
            model.AddObject(Temp2);
            model.AddObject(Temp3);
            model.AddObject(Temp4);
            model.AddObject(Temp5);
            model.AddObject(Temp6);
            model.AddObject(sh);

            model.SetMapSize(50, 50);

            InitializeComponent();

            Draw();
        }