コード例 #1
0
        public MapFinale(ConfigurationGame _conf)
        {
            InitializeComponent();
            time = DateTime.Now;
            conf = _conf;
            switch (conf.Plateau.mytype)
            {
                case MapType.portoloin:
                    design = new MapDesign(Properties.Resources.chaussure, Properties.Resources.sol,
                        Properties.Resources.saule_cogneur, Properties.Resources.bourse);
                    break;
                case MapType.labyrinthe:
                    design = new MapDesign(Properties.Resources.saule_cogneur, Properties.Resources.sol,
                        Properties.Resources.cailloux, Properties.Resources.bourse);
                    break;
                case MapType.standard:
                    design = new MapDesign(Properties.Resources.saule_cogneur, Properties.Resources.sol,
                        Properties.Resources.cailloux, Properties.Resources.bourse);
                    break;
            }

            maSimulation = new GameSimulation(conf, WriteLog);

            UpdateMapLayout();
        }
コード例 #2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(nomEquipeVerte.Text) || string.IsNullOrEmpty(nomEquipeRouge.Text) ||
                lbQueteRouge.Items.Count == 0 || lbQueteVerte.Items.Count == 0)
            {
                return;
            }
            List <Personnage> liste = new List <Personnage>();

            for (int i = 0; i < cbJoueurRouge.SelectedIndex + 1; i++)
            {
                liste.Add(RTeam[i]);
                Parametres.em.Attach(RTeam[i]);
            }

            List <Personnage> liste2 = new List <Personnage>();

            for (int i = 0; i < cbJoueurVerte.SelectedIndex + 1; i++)
            {
                liste2.Add(GTeam[i]);

                Parametres.em.Attach(GTeam[i]);
            }

            List <string> liste3 = new List <string>();

            foreach (string i in lbQueteRouge.Items)
            {
                liste3.Add(i.ToString());
            }
            List <string> liste4 = new List <string>();

            foreach (string i in lbQueteVerte.Items)
            {
                liste4.Add(i.ToString());
            }

            MapType type;

            if (radioMaraudeur.IsChecked.Value)
            {
                type = MapType.labyrinthe;
            }
            else if (RadioEtage.IsChecked.Value)
            {
                type = MapType.portoloin;
            }
            else
            {
                type = MapType.standard;
            }

            ConfigurationGame conf = new ConfigurationGame(nomEquipeRouge.Text, nomEquipeVerte.Text,
                                                           liste, liste2, liste3, liste4, type);
            //MapGame game = new MapGame(conf);
            MapFinale game = new MapFinale(conf);

            game.ShowDialog();
            this.Close();
        }
コード例 #3
0
        public MapFinale(ConfigurationGame _conf)
        {
            InitializeComponent();
            time = DateTime.Now;
            conf = _conf;
            switch (conf.Plateau.mytype)
            {
            case MapType.portoloin:
                design = new MapDesign(Properties.Resources.chaussure, Properties.Resources.sol,
                                       Properties.Resources.saule_cogneur, Properties.Resources.bourse);
                break;

            case MapType.labyrinthe:
                design = new MapDesign(Properties.Resources.saule_cogneur, Properties.Resources.sol,
                                       Properties.Resources.cailloux, Properties.Resources.bourse);
                break;

            case MapType.standard:
                design = new MapDesign(Properties.Resources.saule_cogneur, Properties.Resources.sol,
                                       Properties.Resources.cailloux, Properties.Resources.bourse);
                break;
            }

            maSimulation = new GameSimulation(conf, WriteLog);

            UpdateMapLayout();
        }
コード例 #4
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(nomEquipeVerte.Text) || string.IsNullOrEmpty(nomEquipeRouge.Text)
                || lbQueteRouge.Items.Count == 0 || lbQueteVerte.Items.Count == 0)
                return;
            List<Personnage> liste = new List<Personnage>();
            for (int i = 0; i < cbJoueurRouge.SelectedIndex + 1; i++)
            {
                liste.Add(RTeam[i]);
                Parametres.em.Attach(RTeam[i]);
            }

            List<Personnage> liste2 = new List<Personnage>();
            for (int i = 0; i < cbJoueurVerte.SelectedIndex + 1; i++)
            {
                liste2.Add(GTeam[i]);

                Parametres.em.Attach(GTeam[i]);
            }

            List<string> liste3 = new List<string>();
            foreach (string i in lbQueteRouge.Items)
                liste3.Add(i.ToString());
            List<string> liste4 = new List<string>();
            foreach (string i in lbQueteVerte.Items)
                liste4.Add(i.ToString());

            MapType type ;
            if (radioMaraudeur.IsChecked.Value)
                type = MapType.labyrinthe;
            else if (RadioEtage.IsChecked.Value)
                type = MapType.portoloin;
            else
                type = MapType.standard;

            ConfigurationGame conf = new ConfigurationGame(nomEquipeRouge.Text, nomEquipeVerte.Text,
                    liste, liste2, liste3, liste4, type);
            //MapGame game = new MapGame(conf);
            MapFinale game = new MapFinale(conf);
            game.ShowDialog();
            this.Close();
        }
コード例 #5
0
 public GameSimulation(ConfigurationGame _game, MaraudersAdventure.MapFinale.WriteMessage _handler)
 {
     game    = _game;
     handler = _handler;
     InitGame();
 }
コード例 #6
0
 public GameSimulation(ConfigurationGame _game, MaraudersAdventure.MapFinale.WriteMessage _handler)
 {
     game = _game;
     handler = _handler;
     InitGame();
 }