public void Start(OddOneOutGame game, Action <object, RoutedEventArgs> action) { this.game = game; this.action = action; this.soundtrack.Begin(); this.bubbleMovement.Begin(); this.RefreshGame(); }
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); }
private static void ExtractOddOneOutActivity(ZipArchive archive, IEnumerable <XElement> sequencies, OddOneOutGame activity) { List <OddOneOutActivity> seqs = new List <OddOneOutActivity>(); foreach (XElement sequence in sequencies) { OddOneOutActivity seq = new OddOneOutActivity { new GameOption { Option = new ImageBrush(StreamManipulation.ExtractBitmapImage(archive, string.Format(Images, sequence.Attribute("rightAnswerPath").Value).RemoveFirstSlash())), IsWrong = true }, new GameOption { Option = new ImageBrush(StreamManipulation.ExtractBitmapImage(archive, string.Format(Images, sequence.Attribute("WrongAnswerPath1").Value).RemoveFirstSlash())), IsWrong = false }, new GameOption { Option = new ImageBrush(StreamManipulation.ExtractBitmapImage(archive, string.Format(Images, sequence.Attribute("WrongAnswerPath2").Value).RemoveFirstSlash())), IsWrong = false }, new GameOption { Option = new ImageBrush(StreamManipulation.ExtractBitmapImage(archive, string.Format(Images, sequence.Attribute("WrongAnswerPath3").Value).RemoveFirstSlash())), IsWrong = false } }; seq.PositiveFeedback = sequence.Attribute("positiveFeedback").Value; seq.NegativeFeedback = sequence.Attribute("negativeFeedback").Value; seqs.Add(seq); } activity.Activities = seqs.ToArray(); }