コード例 #1
0
ファイル: Victor.cs プロジェクト: Branlute/victor
        public void LoadContent(ContentManager Content)
        {
            _positionDisguise = new List<Rectangle>();
            _destinationRectangleDisguise = new List<Rectangle>();
            
            //On récupère les informations
            dbc = new DataBaseContext(DataBaseContext.DBConnectionString);

                
                //La tete
                var heads = from accessoire in dbc.Accessoires
                            where accessoire.Modele.Nom == "head"
                            && accessoire.Porte == true
                            select accessoire;

            if(heads.Count()!=0)
            {
                _head = Content.Load<Texture2D>(heads.First().Url);
                _destinationRectangleDisguise.Add(new Rectangle((int)(_position.X + (float)72 * _ratio), (int)(_position.Y - (float)22 * _ratio), (int)((float)71 * _ratio), (int)((float)47 * _ratio)));

                _positionDisguise.Add(new Rectangle((int)((float)72 * _ratio), (int)((float)-22 * _ratio), (int)((float)71 * _ratio), (int)((float)47 * _ratio)));
            }

                
                //Les Pantalons
                var pants = from accessoire in dbc.Accessoires
                            where accessoire.Modele.Nom == "pants"
                            && accessoire.Porte == true
                            select accessoire;
                
            if (pants.Count() != 0)
            {
                _pants = Content.Load<Texture2D>(pants.First().Url);
                _destinationRectangleDisguise.Add(new Rectangle((int)(_position.X + (float)248 * _ratio), (int)(_position.Y + (float)135 * _ratio), (int)((float)95 * _ratio), (int)((float)151 * _ratio)));


                _positionDisguise.Add(new Rectangle((int)((float)248 * _ratio), (int)((float)135 * _ratio), (int)((float)95 * _ratio), (int)((float)151 * _ratio)));
            }

            
                
                //Les T-shirts
                var shirts = from accessoire in dbc.Accessoires
                             where accessoire.Modele.Nom == "shirt"
                             && accessoire.Porte == true
                             select accessoire;


                if (shirts.Count() != 0)
                {
                    _shirt = Content.Load<Texture2D>(shirts.First().Url);
                    _destinationRectangleDisguise.Add(new Rectangle((int)(_position.X + (float)115 * _ratio), (int)(_position.Y + (float)135 * _ratio), (int)((float)130 * _ratio), (int)((float)151 * _ratio)));
                    _positionDisguise.Add(new Rectangle((int)((float)115 * _ratio), (int)((float)135 * _ratio), (int)((float)130 * _ratio), (int)((float)151 * _ratio)));
                }

            dbc.Dispose();
            
            _texture = Content.Load<Texture2D>(@_assetName);

            _sourceRectangleRetournement = new Rectangle(0, 0, (_texture.Width / (_maxIndex + 1)), _texture.Height);

            _destinationRectangleRetournement = new Rectangle(0, 0, (_texture.Width / (_maxIndex + 1)), _texture.Height);

            _sourceRectangle = new List<Rectangle>();
            _sourceRectangle.Add(new Rectangle(0, 0, 66, 51));
            _sourceRectangle.Add(new Rectangle(41, 51, 27, 19));
            _sourceRectangle.Add(new Rectangle(47, 70, 128, 83));
            _sourceRectangle.Add(new Rectangle(173, 96, 27, 37));

            _positionRectangle = new List<Vector2>();
            _positionRectangle.Add(new Vector2(0, 0));
            _positionRectangle.Add(new Vector2(41, 51));
            _positionRectangle.Add(new Vector2(47, 70));
            _positionRectangle.Add(new Vector2(173, 96));

            //_sourceRectangle = new Rectangle(0, 0, _texture.Width / (_maxIndex + 1), _texture.Height);

            _destinationRectangle = new List<Rectangle>();
            _widthRectangle = new List<int>();

            foreach (var position in _sourceRectangle)
            {
                _destinationRectangle.Add(new Rectangle((int)_position.X + position.X, (int)_position.Y + position.Y, position.Width, position.Height));
                _widthRectangle.Add(position.Width);

            }

            List<Rectangle> tmpRectangle = new List<Rectangle>();
            List<Rectangle> tmp2Rectangle = new List<Rectangle>();
            if (_effect == SpriteEffects.FlipHorizontally && flip == false)
            {
                flip = true;

                foreach (var destination in _destinationRectangle)
                {
                    tmpRectangle.Add(new Rectangle(_texture.Width / (_maxIndex + 1) - destination.Width - destination.X + (int)_position.X + (int)_position.X - (_texture.Width / (_maxIndex + 1)), destination.Y, destination.Width, destination.Height));
                }
                _destinationRectangle = tmpRectangle;
                
                foreach (Rectangle destination in _destinationRectangleDisguise)
                {
                    tmp2Rectangle.Add(new Rectangle(_texture.Width / (_maxIndex + 1) - destination.Width - destination.X + (int)_position.X + (int)_position.X - (_texture.Width / (_maxIndex + 1)), destination.Y, destination.Width, destination.Height));

                }
                _destinationRectangleDisguise = tmp2Rectangle;
            }
            else
            {
                if (_effect == SpriteEffects.None && flip == true)
                {
                    flip = false;
                    foreach (var destination in _destinationRectangle)
                    {
                        tmpRectangle.Add(new Rectangle(_texture.Width / (_maxIndex + 1) - destination.Width - destination.X + (int)_position.X, destination.Y, destination.Width, destination.Height));
                    }
                    _destinationRectangle = tmpRectangle;
                    
                    foreach (Rectangle destination in _destinationRectangleDisguise)
                    {
                        tmp2Rectangle.Add(new Rectangle(_texture.Width / (_maxIndex + 1) - destination.Width - destination.X + (int)_position.X, destination.Y, destination.Width, destination.Height));

                    }
                    _destinationRectangleDisguise = tmp2Rectangle;
                }

            }

        }
コード例 #2
0
ファイル: HomeXNA.xaml.cs プロジェクト: Branlute/victor
        private void saveLog(bool vrai)
        {
            //On enregistre la réponse dans les logs
            dbc = new DataBaseContext(DataBaseContext.DBConnectionString);
            var reponse = from rep in dbc.Reponses
                          where rep.Vrai == vrai && rep.QuestionId == question.Id
                          select rep;

            dbc.Logs.InsertOnSubmit(new Log() { Date = DateTime.Now, ReponseId = reponse.First().Id });
            dbc.SubmitChanges();
            dbc.Dispose();
        }
コード例 #3
0
ファイル: HomeXNA.xaml.cs プロジェクト: Branlute/victor
        private string getExplication()
        {
            dbc = new DataBaseContext(DataBaseContext.DBConnectionString);
            Explication explication = dbc.Explications.First(x => x.QuestionId == question.Id);
            dbc.Dispose();

            //Audio
			mp3.IsMuted = false;
            mp3.Source = new Uri(explication.Mp3, UriKind.Relative);
            mp3.Position = new TimeSpan(0);
            mp3.Play();

            return explication.Pourquoi;
        }
コード例 #4
0
ファイル: HomeXNA.xaml.cs プロジェクト: Branlute/victor
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            // Définissez le mode de partage de l'appareil graphique pour activer le rendu XNA
            SharedGraphicsDeviceManager.Current.GraphicsDevice.SetSharingMode(true);

            if (sonPremiere)
            {
                mp3.IsMuted = false;
                mp3.Source = new Uri("/MP3/Home/Menu/HomeMenu.mp3", UriKind.Relative);
                mp3.Position = new TimeSpan(0);
                mp3.Volume = 1;
                mp3.Play();
                sonPremiere = false;
            }
            else
			mp3.IsMuted = true;
            // Créer un nouveau SpriteBatch, qui peut être utilisé pour dessiner des textures.
            spriteBatch = new SpriteBatch(SharedGraphicsDeviceManager.Current.GraphicsDevice);

            question = new Question();
            gridBlanc.Margin = new Thickness(900);
            gridBlanc.Width = 0;

            if (first == true)
            {
                // TODO: utilisez ce contenu pour charger ici le contenu de votre jeu

                //On récupère le niveau et la scène
                var data = this.NavigationContext.QueryString;

                niveau = data["niveau"];
                lvl = data["scene"];

                //Connexion à la BDD
                dbc = new DataBaseContext(DataBaseContext.DBConnectionString);

                /**
                 * BACKGROUND
                **/
                //On récupère l'arrière plan de la scène
                var bg = from scene in dbc.Scenes
                         where scene.Nom == lvl
                         select scene;

                //On affecte
                background = (Application.Current as App).Content.Load<Texture2D>(bg.First().Background);
                positionBackground = Vector2.Zero;

                //Debug, indication des coordonnées du pointeur
                font = (Application.Current as App).Content.Load<SpriteFont>(@"SpriteFont1");

                /**
                 * LES OBJETS
                **/
                lstImage_Interactions = new List<Interaction>();

                var images = from image in dbc.Interactions
                                   where image.Scene.Nom == lvl
                                   select image;               

                /**
                 * RENDU
                **/

                int i = -1;
                Image_Texture textureTmp = new Image_Texture();
                texture_Interactions = new List<Image_Texture>();

                foreach (var interaction in images)
                {
                    //Si l'interaction n'a pas encore d'image 
                    //Créé fonction qui permet d'ajouter une image dans la classe image_interaction
                    if(i != interaction.Id)
                    {
                        if(interaction.Id != images.First().Id)//Si il y a eu une interaction avant, on lance le loader
                        {
                            textureTmp.LoadContent(contentManager);
                            texture_Interactions.Add(textureTmp);
                        }
                        textureTmp = new Image_Texture(interaction.QuestionId, interaction.Question.Nom, interaction.Url, new Vector2(interaction.X, interaction.Y), interaction.Longueur, interaction.Hauteur);
                        
                    }
                    else//Si l'interaction à deja une image ou plusieurs, on rajoute une image
                    {
                        textureTmp.AjoutTexture(interaction.Url, new Vector2(interaction.X, interaction.Y), interaction.Longueur, interaction.Hauteur, (Application.Current as App).Content);
                        //Ajouter une image a l'objet Image_interaction crée précédement.
                    }
                    i = interaction.Id;

                }
                if (images.Count() != 0)//Si il y a des interactions, il faut lancer le content pour la dernière interaction et l'ajouter a la liste
                {
                    textureTmp.LoadContent(contentManager);
                    texture_Interactions.Add(textureTmp);
                }

                //On s'occupe de la lampe
                _lampe = new Image_Texture(-1, "lampe_cuisine", "lampe_cuisine", new Vector2(1250, 0), 130, 258);
                _lampe.LoadContent(contentManager);

                _rotationLampe = 0;
                _deltaRotationLampe = 10;
                _directionLampe = true;


                //On s'occupe des aiguilles
                _petiteAiguille = new Image_Texture(-1, "petite_aiguille", "aiguille-p", new Vector2(379, 43), 3, 12);
                _petiteAiguille.LoadContent(contentManager);
                _rotationGrandeAiguille = 180;

                _grandeAiguille = new Image_Texture(-1, "grande_aiguille", "aiguille-g", new Vector2(379, 43), 3, 23);
                _grandeAiguille.LoadContent(contentManager);
                _rotationPetiteAiguille = 180;



                //On s'occupe de la flamme
                _flammesSprite = new BouteilleCours("FlammesSprites", new Vector2(860, 290), 4);
                _flammesSprite.LoadContent(contentManager);

                /**
                 * FERMETURE BDD
                **/
                dbc.Dispose();

                _uiRenderer = new UIElementRenderer(gridLayout, SharedGraphicsDeviceManager.Current.GraphicsDevice.Viewport.Width, SharedGraphicsDeviceManager.Current.GraphicsDevice.Viewport.Height);

                /**
                 * LES INTERACTIONS
                **/
                TouchPanel.EnabledGestures = GestureType.Tap;

                /**
                 * AUTRES
                **/

                _victor = new Victor("marche", new Vector2(200, 300));


                    _victor.LoadContent(contentManager);
                

                first = false;
            }
            //On replace victor au milieu de l'écran
            else
            {
                TouchPanel.EnabledGestures = GestureType.Tap;
                souris.X = 200;
                souris.Y = 300;
                _destinationSouris.X = 200;
                _destinationSouris.Y = 300;


                    Vector2 tmpVector = new Vector2(200, 300);
                    _victor.Position = tmpVector;
                    _victor.repositionnement();
            }

            _puzzleTexture = contentManager.Load<Texture2D>("puzzle1");
            _puzzle = new Rectangle(900, 900, 0, 0);
            Session.isPuzzleCuisineAvailable();
            _puzzleApparition = 50;
            _collision = false;
            //_retour = new Image_Texture(-1, "retour", "previous", new Vector2(0, 0), 50, 50);
            //_retour.LoadContent(contentManager);

            // Démarrez la minuterie
            timer.Start();

            base.OnNavigatedTo(e);
        }
コード例 #5
0
ファイル: HomeXNA.xaml.cs プロジェクト: Branlute/victor
        private void img_Tap(object sender)
        {
            gridBlanc.Width = 0;
            gridBlanc.Height = 0;
            gridBlanc.Margin = new Thickness(400, 240, 0, 0);

            //On cherche la bonne question à afficher
            dbc = new DataBaseContext(DataBaseContext.DBConnectionString);
            question = dbc.Questions.First(x => x.Id == int.Parse((sender as Image_Texture).IdQuestion.ToString()));
            dbc.Dispose();

            txtQuestion.Text = question.Intitule;

            //Audio
			mp3.IsMuted = false;
            mp3.Source = new Uri(question.Mp3, UriKind.Relative);
            mp3.Position = new TimeSpan(0);
            mp3.Volume = 1;

            uiRenderer = new UIElementRenderer(gridLayout, SharedGraphicsDeviceManager.Current.GraphicsDevice.Viewport.Width, SharedGraphicsDeviceManager.Current.GraphicsDevice.Viewport.Height);
        }
コード例 #6
0
ファイル: Editor.xaml.cs プロジェクト: Branlute/victor
        private void imgToxique_Tap(object sender, GestureEventArgs e)
        {
            dbc = new DataBaseContext(DataBaseContext.DBConnectionString);
            var q = dbc.Questions.First(x => x.Nom == "toxique");
            tmp.QuestionId = q.Id;
            lstInteractions.Add(tmp);
            dbc.Dispose();

            objet = false;
            ContentPanelItem.Visibility = Visibility.Collapsed;
        }
コード例 #7
0
ファイル: Editor.xaml.cs プロジェクト: Branlute/victor
        private void appBarSave_Click(object sender, EventArgs e)
        {
            //On regarde s'il y a des interaction
            if (lstInteractions.Count != 0)
            {
                //On sauvegarde l'image dans l'isolated storage
                string nom = "Victor " + DateTime.Now.Year + "-" + DateTime.Now.Month + "-" + DateTime.Now.Day + " " + DateTime.Now.Hour + "-" + DateTime.Now.Minute + "-" + DateTime.Now.Second + ".jpg";
                WriteableBitmap wb = new WriteableBitmap(img);

                using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication())
                {
                    //On copie dans l'isolated storage
                    IsolatedStorageFileStream fileStream = isf.CreateFile(nom);
                    wb.SaveJpeg(fileStream, wb.PixelWidth, wb.PixelHeight, 0, 100);
                    fileStream.Close();
                }

                //On sauvegarde la photo dans la BDD
                dbc = new DataBaseContext(DataBaseContext.DBConnectionString);

                Photo photo = new Photo() { Background = nom };
                dbc.Photos.InsertOnSubmit(photo);
                dbc.SubmitChanges();

                //On sauvegarde le nom de la photo sur toutes les interactions
                foreach (var q in lstInteractions)
                {
                    q.PhotoId = photo.Id;

                    dbc.InteractionsPhotos.InsertOnSubmit(q);
                }

                dbc.SubmitChanges();
                dbc.Dispose();

                NavigationService.Navigate(new Uri("/Explorer/ExplorerMenu.xaml", UriKind.Relative));
            }
            else
            {
                MessageBox.Show("You cannot save a photo without any danger", "Error", MessageBoxButton.OK);
            }
        }
コード例 #8
0
ファイル: QueryQCM.xaml.cs プロジェクト: Branlute/victor
        private void btnValider_Click(object sender, RoutedEventArgs e)
        {

            if (lbReponses.SelectedIndex == -1)
            {
                MessageBox.Show("You have to select an answer !");
            }
            else
            {
                //On enregistre la réponse dans les logs
                dbc = new DataBaseContext(DataBaseContext.DBConnectionString);
                dbc.Logs.InsertOnSubmit(new Log() { Date = DateTime.Now, ReponseId = int.Parse(((RadioButton)lbReponses.SelectedItem).Name.Split(';').ElementAt(2)) });
                dbc.SubmitChanges();
                dbc.Dispose();

                //On affiche l'écran qui va bien
                if (bool.Parse(((RadioButton)lbReponses.SelectedItem).Name.Split(';').ElementAt(0)) == true)
                {
                    //On appelle l'update en fonction du niveau
                    /*if (niveau == "home")
                    {
                      Session.updateHome(scene, q.Nom);
                    }*/

                    NavigationService.Navigate(new Uri("/Adventure/QCMResultsOK.xaml?id=" + questionId + "&objet=" + q.Nom + "&niveau=" + niveau + "&scene=" + scene, UriKind.Relative));

                    /*if (q.Nom == "casserole")
                    {
                        NavigationService.Navigate(new Uri("/Adventure/Home/Jeux/Cuisine/Casserole.xaml", UriKind.Relative));
                    }*/

                    //On vérifie la disponibilité de la pièce du puzzle
                    if (Session.cuisine_puzzle)
                    {
                        MessageBox.Show("Congratulation you have found the first puzzle piece !");
                    }
                }
                else
                {
                    NavigationService.Navigate(new Uri("/Adventure/QCMResultsNotOK.xaml?id=" + questionId + "&niveau=" + niveau + "&scene=" + scene, UriKind.Relative));
                }
            }
        }
コード例 #9
0
ファイル: GameExplorer.xaml.cs プロジェクト: Branlute/victor
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            // Définissez le mode de partage de l'appareil graphique pour activer le rendu XNA
            SharedGraphicsDeviceManager.Current.GraphicsDevice.SetSharingMode(true);

            mp3.IsMuted = true;


            //On parse 
            var data = this.NavigationContext.QueryString;
            id = int.Parse(data["id"]);

            question = new Question();
            gridBlanc.Margin = new Thickness(900);
            gridBlanc.Width = 0;

            // Créer un nouveau SpriteBatch, qui peut être utilisé pour dessiner des textures.
            spriteBatch = new SpriteBatch(SharedGraphicsDeviceManager.Current.GraphicsDevice);

            // TODO: utilisez ce contenu pour charger ici le contenu de votre jeu
            //On récupère la Photo
            dbc = new DataBaseContext(DataBaseContext.DBConnectionString);
            var photo = from album in dbc.Photos
                        where album.Id == int.Parse(this.NavigationContext.QueryString["id"])
                        select album;

            img = new BitmapImage();

            using (IsolatedStorageFile isoStorage = IsolatedStorageFile.GetUserStoreForApplication())
            {
                if (isoStorage.FileExists(photo.First().Background))
                {
                    using (IsolatedStorageFileStream fileStream = isoStorage.OpenFile(photo.First().Background, FileMode.Open, FileAccess.Read))
                    {
                        img.SetSource(fileStream);
                        fileStream.Close();
                    }
                }
            }

            imgRendu.Source = img;

            _uiRenderer = new UIElementRenderer(gridImage, SharedGraphicsDeviceManager.Current.GraphicsDevice.Viewport.Width, SharedGraphicsDeviceManager.Current.GraphicsDevice.Viewport.Height);



            /**
                 * LES OBJETS
                **/
            lstInteractionsPhotos = new List<InteractionPhoto>();

            var images = from image in dbc.InteractionsPhotos
                         where image.PhotoId == int.Parse(this.NavigationContext.QueryString["id"])
                         select image;




            texture_InteractionsPhotos = new List<Image_TexturePhoto>();

            foreach (var interaction in images)
            {
                texture_InteractionsPhotos.Add(new Image_TexturePhoto(interaction.QuestionId, interaction.Question.Nom, new Vector2((float)interaction.X/512 * 800, (float)interaction.Y/307 * 480), (int)((float)interaction.Longueur/512 * 800), (int)((float)interaction.Hauteur/307 * 480)));
                  

                //Créé fonction qui permet d'ajouter une image dans la classe image_interaction
                /*if (i != interaction.Id)
                {
                    if (interaction.Id != images.First().Id)
                    {
                        textureTmp.LoadContent((Application.Current as App).Content);
                        texture_InteractionsPhotos.Add(textureTmp);
                    }
                    textureTmp = new Image_Texture(interaction.QuestionId, interaction.Question.Nom, interaction.Url, new Vector2(interaction.X, interaction.Y), interaction.Longueur, interaction.Hauteur);

                }
                else
                {*/
                //texture_InteractionsPhotos.Add(AjoutTexture(interaction.Url, new Vector2(interaction.X, interaction.Y), interaction.Longueur, interaction.Hauteur, (Application.Current as App).Content);
                    //Ajouter une image a l'objet Image_interaction crée précédement.
                //}
            }
            foreach (Image_TexturePhoto interaction in texture_InteractionsPhotos)
            {
                interaction.LoadContent(contentManager);
            }

            dbc.Dispose();


            _victor = new Victor("marche", new Vector2(100,300));
            _victor.LoadContent(contentManager);




            _collision = false;
            click_souris = false;


            /*_retour = new Image_Texture(-1, "retour", "previous", new Vector2(0, 0), 50, 50);
            _retour.LoadContent(contentManager);
            */


            if(!first)
            {
                TouchPanel.EnabledGestures = GestureType.Tap;
                souris.X = 200;
                souris.Y = 300;


                    Vector2 tmpVector = new Vector2(200, 300);
                    _victor.Position = tmpVector;
                    _victor.repositionnement();

            }
            /**
             * LES INTERACTIONS
            **/
            TouchPanel.EnabledGestures = GestureType.Tap;



            // Démarrez la minuterie
            timer.Start();

            base.OnNavigatedTo(e);
        }
コード例 #10
0
ファイル: Init.cs プロジェクト: Branlute/victor
        public static void InitBDD()
        {
            //Vérification de l'existence de la BDD
            DataBaseContext dbc = new DataBaseContext(DataBaseContext.DBConnectionString);

            dbc.DeleteDatabase();

            if (!dbc.DatabaseExists())
            {
                dbc.CreateDatabase();

                #region Niveau

                Niveau home = new Niveau() { Nom = "home", Fini = false };
                Niveau holiday = new Niveau() { Nom = "holiday", Fini = false };
                
                dbc.Niveaux.InsertOnSubmit(home);
                dbc.Niveaux.InsertOnSubmit(holiday);
                dbc.SubmitChanges();

                #endregion

                #region Scene

                /**
                 * HOME
                 * */
                Scene home_cuisine = new Scene() { Background = "home_cuisine", Nom = "cuisine", NiveauId = home.Id };
                Scene home_salon = new Scene() { Background = "home_salon", Nom = "salon", NiveauId = home.Id };

                dbc.Scenes.InsertOnSubmit(home_cuisine);
                dbc.Scenes.InsertOnSubmit(home_salon);
                dbc.SubmitChanges();

                #endregion

                #region Jeu
                /**
                 * HOME
                 * */
                //Cuisine
                Jeu j1 = new Jeu() { Nom = "casserole", Explication = "TEST", Mp3 = "MP3/Home/Cuisine/fourQuestion.mp3", Debloque = false };
                Jeu j2 = new Jeu() { Nom = "toxique", Explication = "TEST", Mp3 = "MP3/Home/Cuisine/fourQuestion.mp3", Debloque = false };
                Jeu j3 = new Jeu() { Nom = "grillepain", Explication = "TEST", Mp3 = "MP3/Home/Cuisine/fourQuestion.mp3", Debloque = false };
                Jeu j4 = new Jeu() { Nom = "couteau", Explication = "TEST", Mp3 = "MP3/Home/Cuisine/fourQuestion.mp3", Debloque = false };
                Jeu j5 = new Jeu() { Nom = "four", Explication = "TEST", Mp3 = "MP3/Home/Cuisine/fourQuestion.mp3", Debloque = false };

                dbc.Jeux.InsertOnSubmit(j1);
                dbc.Jeux.InsertOnSubmit(j2);
                dbc.Jeux.InsertOnSubmit(j3);
                dbc.Jeux.InsertOnSubmit(j4);
                dbc.Jeux.InsertOnSubmit(j5);
                dbc.SubmitChanges();

                #endregion

                #region Question

                /**
                 * HOME
                 * */
                //Cuisine
                Question q1 = new Question() { Nom = "four", Intitule = "The apple pie in the oven smells good ! Can I open the door and take a piece of cake ?", Vrai = false, Mp3 = "MP3/Home/Cuisine/fourQuestion.mp3", Url = "/Images/Jeu/Home/Cuisine/victorFour.png", Qcm = true, JeuId = j5.Id, SceneId = home_cuisine.Id };
                Question q2 = new Question() { Nom = "casserole", Intitule = "I am sure that one the pieces of my puzzle is in this pan ! Can I take it to verify ?", Vrai = false,  Mp3 = "MP3/Home/Cuisine/casseroleQuestion.mp3", Url = "/Images/Jeu/Home/Cuisine/victorCasserole.png", Qcm = true, JeuId = j1.Id, SceneId = home_cuisine.Id };
                Question q3 = new Question() { Nom = "couteau", Intitule = "I am sure that this knife can be useful to find the piece of my puzzle ! Should I take him with me ?", Vrai = false,  Mp3 = "MP3/Home/Cuisine/couteauQuestion.mp3", Url = "/Images/Jeu/Home/Cuisine/victorCouteau.png", Qcm = true, JeuId = j4.Id, SceneId = home_cuisine.Id };
                Question q4 = new Question() { Nom = "toxique", Intitule = "Oh this is first time that I see this bottle ! I am sure that this new orange juice is delicious ! Can I drink it ?", Vrai = false, Mp3 = "MP3/Home/Cuisine/bottleQuestion.mp3", Url = "/Images/Jeu/Home/Cuisine/victorBidon.png", Qcm = true, JeuId = j2.Id, SceneId = home_cuisine.Id };
                Question q5 = new Question() { Nom = "tasse", Intitule = "I am thirsty ! Reorganize the following photos to help me to drink !", Vrai = false, Mp3 = "MP3/Home/Cuisine/tasseQuestion.mp3", Url = "/Images/Jeu/Home/Cuisine/victorVerre.png", Qcm = false, SceneId = home_cuisine.Id };
                Question q6 = new Question() { Nom = "grillepain", Intitule = "I am sure that one the piece of the puzzle is jammed into the toaster !  Can I check if nothing is jammed into the toaster ?", Vrai = false, Mp3 = "MP3/Home/Cuisine/toasterQuestion.mp3", Url = "/Images/Jeu/Home/Cuisine/victorGrillepain.png", Qcm = true, JeuId = j3.Id, SceneId = home_cuisine.Id };

                dbc.Questions.InsertOnSubmit(q1);
                dbc.Questions.InsertOnSubmit(q2);
                dbc.Questions.InsertOnSubmit(q3);
                dbc.Questions.InsertOnSubmit(q4);
                dbc.Questions.InsertOnSubmit(q5);
                dbc.Questions.InsertOnSubmit(q6);
                dbc.SubmitChanges();

                //Salon
                Question q7 = new Question() { Nom = "cheminee", Intitule = "I am thirsty ! Reorganize the following photos to help me to drink !", Mp3 = "MP3/Home/Cuisine/tasseQuestion.mp3", Url = "/Images/Jeu/Home/Cuisine/victorVerre.png", Qcm = true, SceneId = home_salon.Id };
                Question q8 = new Question() { Nom = "prises", Intitule = "I am thirsty ! Reorganize the following photos to help me to drink !", Mp3 = "MP3/Home/Cuisine/tasseQuestion.mp3", Url = "/Images/Jeu/Home/Cuisine/victorVerre.png", Qcm = true, SceneId = home_salon.Id };
                Question q9 = new Question() { Nom = "radiateur", Intitule = "I am thirsty ! Reorganize the following photos to help me to drink !", Mp3 = "MP3/Home/Cuisine/tasseQuestion.mp3", Url = "/Images/Jeu/Home/Cuisine/victorVerre.png", Qcm = true, SceneId = home_salon.Id };
                Question q10 = new Question() { Nom = "ventilateur", Intitule = "I am thirsty ! Reorganize the following photos to help me to drink !", Mp3 = "MP3/Home/Cuisine/tasseQuestion.mp3", Url = "/Images/Jeu/Home/Cuisine/victorVerre.png", Qcm = true, SceneId = home_salon.Id };
    
                dbc.Questions.InsertOnSubmit(q7);
                dbc.Questions.InsertOnSubmit(q8);
                dbc.Questions.InsertOnSubmit(q9);
                dbc.Questions.InsertOnSubmit(q10);
                dbc.SubmitChanges();

                #endregion

                #region Interaction

                /**
                 * HOME
                 * */

                //Cuisine
                Interaction i1 = new Interaction() { Url = "four", X = 1129, Y = 216, Longueur = 160, Hauteur = 200, SceneId = home_cuisine.Id, QuestionId = q1.Id };
                Interaction i2 = new Interaction() { Url = "casserole", X = 1195, Y = 215, Longueur = 98, Hauteur = 60, SceneId = home_cuisine.Id, QuestionId = q2.Id };
                //Interaction i3 = new Interaction() { Url = "casserole2", X = 2810, Y = 247, Longueur = 35, Hauteur = 8, SceneId = home_cuisine.Id, QuestionId = q2.Id };
                Interaction i4 = new Interaction() { Url = "couteau", X = 1342, Y = 184, Longueur = 40, Hauteur = 80, SceneId = home_cuisine.Id, QuestionId = q3.Id };
                Interaction i5 = new Interaction() { Url = "toxique", X = 1397, Y = 319, Longueur = 70, Hauteur = 90, SceneId = home_cuisine.Id, QuestionId = q4.Id };
                //Interaction i6 = new Interaction() { Url = "verre", X = 1289, Y = 227, Longueur = 25, Hauteur = 35, SceneId = home_cuisine.Id, QuestionId = q5.Id };
                Interaction i7 = new Interaction() { Url = "grillepain", X = 1080, Y = 220, Longueur = 80, Hauteur = 52, SceneId = home_cuisine.Id, QuestionId = q6.Id };

                dbc.Interactions.InsertOnSubmit(i1);
                dbc.Interactions.InsertOnSubmit(i2);
                //dbc.Interactions.InsertOnSubmit(i3);
                dbc.Interactions.InsertOnSubmit(i4);
                dbc.Interactions.InsertOnSubmit(i5);
                //dbc.Interactions.InsertOnSubmit(i6);
                dbc.Interactions.InsertOnSubmit(i7);
                dbc.SubmitChanges();

                //Salon
                Interaction i8 = new Interaction() { Url = "cheminee", X = 119, Y = -100, Longueur = 66, Hauteur = 334, SceneId = home_salon.Id, QuestionId = q7.Id };
                Interaction i9 = new Interaction() { Url = "prises", X = 241, Y = 193, Longueur = 18, Hauteur = 8, SceneId = home_salon.Id, QuestionId = q8.Id };
                Interaction i10 = new Interaction() { Url = "radiateur", X = 289, Y = 125, Longueur = 141, Hauteur = 75, SceneId = home_salon.Id, QuestionId = q9.Id };
                Interaction i11 = new Interaction() { Url = "ventilo", X = 703, Y = 347, Longueur = 99, Hauteur = 110, SceneId = home_salon.Id, QuestionId = q10.Id };

                dbc.Interactions.InsertOnSubmit(i8);
                dbc.Interactions.InsertOnSubmit(i9);
                dbc.Interactions.InsertOnSubmit(i10);
                dbc.Interactions.InsertOnSubmit(i11);
                dbc.SubmitChanges();

                #endregion

                #region Reponse
                /**
                 * HOME
                 * */
                //Cuisine
                Reponse r1 = new Reponse() { Intitule = "Yes I can ! Nobody will never know about this !", Vrai = false, QuestionId = q1.Id };
                Reponse r2 = new Reponse() { Intitule = "No, I cannot ! The oven can be warm  and it is dangerous !", Vrai = true, QuestionId = q1.Id };

                Reponse r4 = new Reponse() { Intitule = "Yes I can ! There is no risk ! My parents take this pan everyday !", Vrai = false, QuestionId = q2.Id };
                Reponse r3 = new Reponse() { Intitule = "No, I cannot ! The pan can be warm or contain something warm and it is dangerous !", Vrai = true, QuestionId = q2.Id };

                Reponse r5 = new Reponse() { Intitule = "Yes I can ! Using this knife to find the piece of the puzzle will be amazing !", Vrai = false, QuestionId = q3.Id };
                Reponse r6 = new Reponse() { Intitule = "No I cannot ! Knives are dangerous ! I can cut myself !", Vrai = true, QuestionId = q3.Id };

                Reponse r8 = new Reponse() { Intitule = "Yes I can ! At worst it is not good !", Vrai = false, QuestionId = q4.Id };
                Reponse r7 = new Reponse() { Intitule = "No I cannot ! It is dangerous to drink something if I do not know what it is !", Vrai = true, QuestionId = q4.Id };

                Reponse r9 = new Reponse() { Intitule = "Yes I can ! Maybe I will find my piece of puzzle and a delicious toast !", Vrai = false, QuestionId = q6.Id };
                Reponse r10 = new Reponse() { Intitule = "No I cannot ! My parents told me several times that I cannot touch the toaster !", Vrai = true, QuestionId = q6.Id };

                dbc.Reponses.InsertOnSubmit(r1);
                dbc.Reponses.InsertOnSubmit(r2);
                dbc.Reponses.InsertOnSubmit(r3);
                dbc.Reponses.InsertOnSubmit(r4);
                dbc.Reponses.InsertOnSubmit(r5);
                dbc.Reponses.InsertOnSubmit(r6);
                dbc.Reponses.InsertOnSubmit(r7);
                dbc.Reponses.InsertOnSubmit(r8);
                dbc.Reponses.InsertOnSubmit(r9);
                dbc.Reponses.InsertOnSubmit(r10);
                dbc.SubmitChanges();

                //Salon
                Reponse r11 = new Reponse() { Intitule = "Yes I can ! Maybe I will find my piece of puzzle and a delicious toast !", Vrai = false, QuestionId = q7.Id };
                Reponse r12 = new Reponse() { Intitule = "No I cannot ! My parents told me several times that I cannot touch the toaster !", Vrai = true, QuestionId = q7.Id };

                Reponse r13 = new Reponse() { Intitule = "Yes I can ! Maybe I will find my piece of puzzle and a delicious toast !", Vrai = false, QuestionId = q8.Id };
                Reponse r14 = new Reponse() { Intitule = "No I cannot ! My parents told me several times that I cannot touch the toaster !", Vrai = true, QuestionId = q8.Id };

                Reponse r15 = new Reponse() { Intitule = "Yes I can ! Maybe I will find my piece of puzzle and a delicious toast !", Vrai = false, QuestionId = q9.Id };
                Reponse r16 = new Reponse() { Intitule = "No I cannot ! My parents told me several times that I cannot touch the toaster !", Vrai = true, QuestionId = q9.Id };

                Reponse r17 = new Reponse() { Intitule = "Yes I can ! Maybe I will find my piece of puzzle and a delicious toast !", Vrai = false, QuestionId = q10.Id };
                Reponse r18 = new Reponse() { Intitule = "No I cannot ! My parents told me several times that I cannot touch the toaster !", Vrai = true, QuestionId = q10.Id };
                
                dbc.Reponses.InsertOnSubmit(r11);
                dbc.Reponses.InsertOnSubmit(r12);
                dbc.Reponses.InsertOnSubmit(r13);
                dbc.Reponses.InsertOnSubmit(r14);
                dbc.Reponses.InsertOnSubmit(r15);
                dbc.Reponses.InsertOnSubmit(r16);
                dbc.Reponses.InsertOnSubmit(r17);
                dbc.Reponses.InsertOnSubmit(r18);
                dbc.SubmitChanges();

                #endregion

                #region Explications
                /**
                 * HOME
                 * */
                //Cuisine
                Explication e1 = new Explication() { Mp3 = "MP3/Home/Cuisine/fourExplication.mp3", Pourquoi = "You cannot touch or open the door of an oven. It can be very warm and it is dangerous ! You can burn yourself ! Only adults can open and touch an oven !", QuestionId = q1.Id };
                Explication e2 = new Explication() { Mp3 = "MP3/Home/Cuisine/casseroleExplication.mp3", Pourquoi = "You cannot touch a pan. It can be very warm and it is dangerous ! You can burn yourself ! Only adults can use it !", QuestionId = q2.Id };
                Explication e3 = new Explication() { Mp3 = "MP3/Home/Cuisine/couteauExplication.mp3", Pourquoi = "You cannot touch a knife. It is very dangerous because it can cut your skin ! Only adults can use it ! This knife is not in plastic, it is a real !", QuestionId = q3.Id };
                Explication e4 = new Explication() { Mp3 = "MP3/Home/Cuisine/bottleExplication.mp3", Pourquoi = "Have you seen this warning symbol on the bottle ? It means that this bottle contains a very dangerous product. You cannot touch or drink it ! You could poison yourself ! ", QuestionId = q4.Id };
                Explication e5 = new Explication() { Mp3 = "MP3/Home/Cuisine/tasseExplication.mp3", Pourquoi = "First, you have to turn on the tap and select cold water without touch it because the water can be warm ! After a while, you have to touch the water with your finger to check if the it is not to warm. Finally, you can drink ! Don't forget to turn off the tap when it is finished !", QuestionId = q5.Id };
                Explication e6 = new Explication() { Mp3 = "MP3/Home/Cuisine/toasterExplication.mp3", Pourquoi = "You cannot touch the toaster ! It can be warm and you can burn yourself ! Moreover, you can be electrocuted if you touch it with a metal object !", QuestionId = q6.Id };

                dbc.Explications.InsertOnSubmit(e1);
                dbc.Explications.InsertOnSubmit(e2);
                dbc.Explications.InsertOnSubmit(e3);
                dbc.Explications.InsertOnSubmit(e4);
                dbc.Explications.InsertOnSubmit(e5);
                dbc.Explications.InsertOnSubmit(e6);
                dbc.SubmitChanges();

                //Salon
                Explication e7 = new Explication() { Mp3 = "MP3/Home/Cuisine/toasterExplication.mp3", Pourquoi = "You cannot touch the toaster ! It can be warm and you can burn yourself ! Moreover, you can be electrocuted if you touch it with a metal object !", QuestionId = q7.Id };
                Explication e8 = new Explication() { Mp3 = "MP3/Home/Cuisine/toasterExplication.mp3", Pourquoi = "You cannot touch the toaster ! It can be warm and you can burn yourself ! Moreover, you can be electrocuted if you touch it with a metal object !", QuestionId = q8.Id };
                Explication e9 = new Explication() { Mp3 = "MP3/Home/Cuisine/toasterExplication.mp3", Pourquoi = "You cannot touch the toaster ! It can be warm and you can burn yourself ! Moreover, you can be electrocuted if you touch it with a metal object !", QuestionId = q9.Id };
                Explication e10 = new Explication() { Mp3 = "MP3/Home/Cuisine/toasterExplication.mp3", Pourquoi = "You cannot touch the toaster ! It can be warm and you can burn yourself ! Moreover, you can be electrocuted if you touch it with a metal object !", QuestionId = q10.Id };
                
                dbc.Explications.InsertOnSubmit(e7);
                dbc.Explications.InsertOnSubmit(e8);
                dbc.Explications.InsertOnSubmit(e9);
                dbc.Explications.InsertOnSubmit(e10);
                dbc.SubmitChanges();

                #endregion

                #region Modele

                Modele shirt = new Modele() { Nom = "shirt" };
                Modele pants = new Modele() { Nom = "pants" };
                Modele head = new Modele() { Nom = "head" };
                Modele accessory = new Modele() { Nom = "accessory" };

                dbc.Modeles.InsertOnSubmit(shirt);
                dbc.Modeles.InsertOnSubmit(pants);
                dbc.Modeles.InsertOnSubmit(head);
                dbc.Modeles.InsertOnSubmit(accessory);
                dbc.SubmitChanges();

                #endregion

                #region Accessoire

                //Les vêtements
                Accessoire a1 = new Accessoire() { Url = "Images/Accessoires/head_plage", Dispo = true, ModeleId = head.Id, NiveauId = holiday.Id, Porte = false};
                Accessoire a2 = new Accessoire() { Url = "Images/Accessoires/pants_plage", Dispo = true, ModeleId = pants.Id, NiveauId = holiday.Id, Porte = false };
                Accessoire a3 = new Accessoire() { Url = "Images/Accessoires/shirt_plage", Dispo = true, ModeleId = shirt.Id, NiveauId = holiday.Id, Porte = false };
                Accessoire a4 = new Accessoire() { Url = "Images/Accessoires/head_home", Dispo = false, ModeleId = head.Id, NiveauId = home.Id, Porte = false };
                Accessoire a5 = new Accessoire() { Url = "Images/Accessoires/pants_home", Dispo = false, ModeleId = pants.Id, NiveauId = home.Id, Porte = false };
                Accessoire a6 = new Accessoire() { Url = "Images/Accessoires/shirt_home", Dispo = false, ModeleId = shirt.Id, NiveauId = home.Id, Porte = false };

                dbc.Accessoires.InsertOnSubmit(a1);
                dbc.Accessoires.InsertOnSubmit(a2);
                dbc.Accessoires.InsertOnSubmit(a3);
                dbc.Accessoires.InsertOnSubmit(a4);
                dbc.Accessoires.InsertOnSubmit(a5);
                dbc.Accessoires.InsertOnSubmit(a6);
                dbc.SubmitChanges();

                #endregion

                //On ferme le connexion
                dbc.Dispose();
            }
        }