public void Setup() { mockLightActuator = new Mock <ILightActuator>(); mockObserver = new Mock <IObserver>(); lightContext = new LightContext(mockLightActuator.Object); lightContext.Observer = mockObserver.Object; }
public Light() { this.lightActuator = new LightActuator(); this.context = new LightContext(lightActuator); this.context.Observer = ObserverConsole.Instance; this.context.EnterInitialState(); }
public void Setup() { repository = new MockRepository(); lightActuator = repository.StrictMock <ILightActuator>(); observer = repository.StrictMock <IObserver>(); lightContext = new LightContext(lightActuator); lightContext.Observer = observer; }
/// <summary> /// 状态模式--灯 /// </summary> static void TestLightState() { LightContext context = new LightContext(new LightOff()); context.PressSwitch(); context.PressSwitch(); context.PressSwitch(); context.PressSwitch(); }
public LightSource(int textureIndex, Vector2 position, float radius, LightContext light_context = LightContext.None, long playerID = 0L) : this() { this.textureIndex.Value = textureIndex; this.position.Value = position; this.radius.Value = radius; color.Value = Color.Black; lightContext.Value = light_context; this.playerID.Value = playerID; }
public LightsController(LightContext context) { _context = context; }
public LightSource(int textureIndex, Vector2 position, float radius, Color color, int identifier, LightContext light_context = LightContext.None, long playerID = 0L) : this() { this.textureIndex.Value = textureIndex; this.position.Value = position; this.radius.Value = radius; this.color.Value = color; this.identifier.Value = identifier; lightContext.Value = light_context; this.playerID.Value = playerID; }