private void clear(exit exitValue) { Log(Environment.NewLine + "performing current attempt clear, exit: " + exitValue + Environment.NewLine); LETSIRTE_Service client = getClient(); cocdType cmi = client.Get(); int expectedLength = cmi.attemptNumber; cmi.progressMeasure = null; cmi.progressMeasureSpecified = true; cmi.completionStatus = completionStatusType.unknown; cmi.completionStatusSpecified = true; cmi.successStatus = successStatusType.unknown; cmi.successStatusSpecified = true; cmi.scoreScaled = null; cmi.scoreScaledSpecified = true; cmi.exit = exitValue; cmi.exitSpecified = true; client.Set(cmi); attemptSummary[] attempts = client.GetAttemptList(); foreach (attemptSummary att in attempts) { Log(att.ToString()); } //Did we create a new attempt? Boolean exitCreatedNewAttempt = (exitValue == exit.normal || exitValue == exit.Item); expectedLength += (exitCreatedNewAttempt ? 1 : 0); Assert.AreEqual(expectedLength, attempts.Length); attemptSummary latest = attempts[attempts.Length - (1 + (exitCreatedNewAttempt ? 1 : 0))]; Assert.AreEqual(cmi.scoreScaled, latest.scoreScaled); Assert.AreEqual(cmi.successStatus, latest.successStatus); Assert.AreEqual(cmi.completionStatus, latest.completionStatus); Assert.AreEqual(cmi.progressMeasure, latest.progressMeasure); Assert.AreEqual(exitValue == exit.suspend ? entry.resume : entry.other, latest.entry); Log("verified clear"); }
public void LoadContent() { level = new Levels(content); level.CreateWorld(lvl); enemy = new enemys(content, level.colli, lvl); enemy.CreateEnemy(); camera = new Camera(graphicsDevice.Viewport); texture = content.Load <Texture2D>("Hero/spritesheet"); valsstrik = content.Load <Texture2D>("Level/dood"); exit = content.Load <Texture2D>("Level/exit"); hero = new Speler(texture, level.colli, content); spring = content.Load <SoundEffect>("Geluid/spring"); if (!lvl) { bgtexture = content.Load <Texture2D>("Background/level1background"); } else { bgtexture = content.Load <Texture2D>("Background/level2background"); } ex = new exit(exit, lvl); vals = new val(valsstrik); vals.CreateVal(); }
private void set(exit exitValue) { Log(Environment.NewLine + "performing current attempt sets, exit: " + exitValue + Environment.NewLine); LETSIRTE_Service client = getClient(); cocdType cmi = client.Get(); int expectedLength = cmi.attemptNumber; cmi.progressMeasure = (((decimal)expectedLength) + .5M) / 10; cmi.progressMeasureSpecified = true; cmi.completionStatus = completionStatusType.completed; cmi.completionStatusSpecified = true; cmi.successStatus = successStatusType.passed; cmi.successStatusSpecified = true; cmi.scoreScaled = cmi.progressMeasure / 2; cmi.scoreScaledSpecified = true; cmi.exit = exitValue; cmi.exitSpecified = true; client.Set(cmi); attemptSummary[] attempts = client.GetAttemptList(); foreach (attemptSummary att in attempts) { Log(att.ToString()); } //Did we create a new attempt? Boolean exitCreatedNewAttempt = (exitValue == exit.normal || exitValue == exit.Item); expectedLength += (exitCreatedNewAttempt ? 1 : 0); Assert.AreEqual(expectedLength, attempts.Length); attemptSummary latest = attempts[attempts.Length - (1 + (exitCreatedNewAttempt ? 1 : 0))]; Assert.AreEqual(cmi.scoreScaled, latest.scoreScaled); Assert.AreEqual(cmi.successStatus, latest.successStatus); Assert.AreEqual(cmi.completionStatus, latest.completionStatus); Assert.AreEqual(cmi.progressMeasure, latest.progressMeasure); Assert.AreEqual(exitValue == exit.suspend ? entry.resume : entry.other, latest.entry); Log("verified set"); }