Ejemplo n.º 1
0
        private static void ExtractNoGoNoActivity(ZipArchive archive, XElement game, GoNoGoGame activity)
        {
            NoGoNoActivity gameActivity = new NoGoNoActivity
            {
                new GameOption
                {
                    Option  = new ImageBrush(StreamManipulation.ExtractBitmapImage(archive, string.Format(Images, game.Attribute("GoNoGoFocusImage").Value).RemoveFirstSlash())),
                    IsWrong = true
                },
                new GameOption
                {
                    Option  = new ImageBrush(StreamManipulation.ExtractBitmapImage(archive, string.Format(Images, game.Attribute("GoNoGoWrongImage1").Value).RemoveFirstSlash())),
                    IsWrong = false
                },
                new GameOption
                {
                    Option  = new ImageBrush(StreamManipulation.ExtractBitmapImage(archive, string.Format(Images, game.Attribute("GoNoGoWrongImage2").Value).RemoveFirstSlash())),
                    IsWrong = false
                },
                new GameOption
                {
                    Option  = new ImageBrush(StreamManipulation.ExtractBitmapImage(archive, string.Format(Images, game.Attribute("GoNoGoWrongImage3").Value).RemoveFirstSlash())),
                    IsWrong = false
                }
            };

            activity.TriggerInterval = TimeSpan.FromSeconds(Convert.ToInt32(game.Attribute("TriggerInterval").Value));
            activity.Activities      = new NoGoNoActivity[] { gameActivity };
        }
Ejemplo n.º 2
0
        public void Start(GoNoGoGame game, Action <object, RoutedEventArgs> action)
        {
            this.game   = game;
            this.action = action;

            this.src[0] = this.game.Activities.First()[0].Option.ImageSource;

            if (!this.game.Activities.First()[0].IsWrong)
            {
                this.CorrectIndex = 0;
            }
            this.src[1] = this.game.Activities.First()[1].Option.ImageSource;

            if (!this.game.Activities.First()[1].IsWrong)
            {
                this.CorrectIndex = 1;
            }


            this.src[2] = this.game.Activities.First()[2].Option.ImageSource;
            if (!this.game.Activities.First()[2].IsWrong)
            {
                this.CorrectIndex = 2;
            }

            this.src[3] = this.game.Activities.First()[3].Option.ImageSource;
            if (!this.game.Activities.First()[3].IsWrong)
            {
                this.CorrectIndex = 3;
            }
        }
Ejemplo n.º 3
0
        private static KinectActivity ExtractKinectActivity(ZipArchive archive, XElement activityDescription, XElement page)
        {
            if (archive == null)
            {
                throw new ArgumentNullException("archive");
            }

            if (activityDescription == null)
            {
                return(null);
            }

            switch (activityDescription.Attribute("type").Value)
            {
            case "OddOneOut":
                OddOneOutGame oddOneOutActivity = new OddOneOutGame {
                    Name = "OddOneOutActivity"
                };
                ExtractOddOneOutActivity(archive, page.Descendants("OddOneOutSequence"), oddOneOutActivity);
                return(oddOneOutActivity);

            case "SimonSays":
                SimonSaysGame simonSaysActivity = new SimonSaysGame {
                    Name = "SimonSaysActivity"
                };
                ExtractSimonSaysActivity(archive, activityDescription, simonSaysActivity);
                return(simonSaysActivity);

            case "GoNoGo":
                GoNoGoGame noGoNoGame = new GoNoGoGame {
                    Name = "NoGoNoActivity"
                };
                ExtractNoGoNoActivity(archive, activityDescription, noGoNoGame);
                return(noGoNoGame);

            case "VirtualDrumkit":
                break;

            default:
                break;
            }

            return(null);
        }