public void ShouldSpawnObjectsOnEntry() { var state = new FadeOutState(gameManagerMock.Object, true); state.OnEntry(); gameManagerMock.Verify(foo => foo.FadeOut()); }
public void ShouldTransitionOnAfterAWhile() { var state = new FadeOutState(gameManagerMock.Object, true); state.OnEntry(); timeProviderMock.Setup(foo => foo.Time).Returns(0); for (int i = 0; i < 10; i++) { // Just run a bunch to show it's not transitioning Assert.IsNull(state.OnDuring()); } timeProviderMock.Setup(foo => foo.Time).Returns(FadeOutState.fadeoutTime + 1); Assert.IsTrue(state.OnDuring() is UpdatePointsState); }
public AODText(Game game, string text, float lifeTime, Color color, Vector2 position, FadeOutState fadeOutState, Vector2 velocity, bool centerize) { font = game.Content.Load <SpriteFont>(@"msyh"); this.game = game; this.Text = text; this.color = color; this.position = position; this.lifeTime = lifeTime; this.FadeOutState = fadeOutState; this.velocity = velocity; this.centerize = centerize; }
public AODText(GameWorld gameWorld, string text, float lifeTime, Color color, Vector2 position, FadeOutState fadeOutState, Vector2 velocity, bool centerize) { this.gameWorld = gameWorld; this.game = gameWorld.game; font = gameWorld.GameFont; this.Text = text; this.color = color; this.position = position; this.lifeTime = lifeTime; this.FadeOutState = fadeOutState; this.velocity = velocity; this.centerize = centerize; }
public static AODText CreateText(string text, float lifeTime, Color color, Vector2 position, GameWorld gameWorld, FadeOutState fadeOutState, Vector2 velocity) { AODText a = AODText.CreateText(text, lifeTime, color, position, gameWorld, fadeOutState); a.velocity = velocity; return(a); }
/// <summary> /// 创建一行信息 /// </summary> /// <param name="text">内容</param> /// <param name="lifeTime">存在时间</param> /// <param name="color">颜色</param> /// <param name="position">位置</param> public static AODText CreateText(string text, float lifeTime, Color color, Vector2 position, GameWorld gameWorld, FadeOutState fadeOutState) { AODText a = new AODText(gameWorld); a.Text = text; a.color = color; a.position = position; a.lifeTime = lifeTime; a.FadeOutState = fadeOutState; return(a); }
public AODText(GameWorld gameWorld, string text, float lifeTime, Color color, Vector2 position, FadeOutState fadeOutState, Vector2 velocity, bool centerize, float scale) : this(gameWorld, text, lifeTime, color, position, fadeOutState, velocity, centerize) { this.scale = scale; }