public Pet removeFromChain() { Pet temp = new Pet(); if (front > 0) { temp = chain[front - 1]; chain.RemoveAt(front - 1); front--; LayerStack.revoke(); return(temp); } Debug.Log("No pets to remove"); return(null); }
protected Application(Type windowType) { #if DEBUG using Profiler fullProfiler = new Profiler(GetType()); #endif CultureInfo.DefaultThreadCurrentCulture = CultureInfo.InvariantCulture; CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.InvariantCulture; Logger.Init(); Logger.Assert(App == null, "App already initialized"); App = this; LayerStack = new LayerStack(); Window = WindowBase.CreateMainWindow(windowType); Window.EventCallback = OnEvent; ImGuiLayer = new ImGuiLayer(); LayerStack.PushOverlay(ImGuiLayer); }
public QuestionsPage() { InitializeComponent(); var LessonModel = Data.Instance.Lesson; LayerStackDC = new LayerStack( LessonModel.Exercises, LessonModel); LessonPage = new Exercises(LayerStackDC, (int)DrawingAreaBound.Width, (int)DrawingAreaBound.Height); LessonPage.SetComponents(null, LessonSidebar.ThumbsContainer); LayerStackDC.Init(LessonPage); LayerStackDC.Viewport.SetComponents(LessonContainer, LessonContent, DrawingAreaBound, RadialMenu); appBar = AppBar.DataContext as AppBarState; DataContext = this; }
public async Task GeneratedService_GeneratedProxy_PayloadResponse_LayerData() { LayerStack <Dummy> layerStack = new LayerStack <Dummy>(new TestLayer_CheckPassedValue(1234)); TestClientServer <DummyTestService> testClientServer = await SetupTestClientServer <DummyTestService>(layerStack, layerStack); var proxy = new DummyTestProxy <EpoxyConnection>(testClientServer.ClientConnection); var request = new Dummy { int_value = 100 }; IMessage <Dummy> response = await proxy.ReqRspMethodAsync(request); Assert.IsFalse(response.IsError); Assert.AreEqual(101, response.Payload.Deserialize().int_value); Assert.AreEqual(1, testClientServer.Service.RequestCount); await testClientServer.ServiceTransport.StopAsync(); await testClientServer.ClientTransport.StopAsync(); }
public void LayerStack_OnSend_InvokesForwardOrder() { var testList = new List <string>(); var testLayer1 = new TestLayer_Append("foo", testList); var testLayer2 = new TestLayer_Append("bar", testList); var stack = new LayerStack <Dummy>(testLayer1, testLayer2); IBonded layerData; Error error = stack.OnSend(MessageType.Request, sendContext, out layerData); Assert.IsNull(error); Assert.IsNotNull(layerData); Dummy realLayerData = layerData.Deserialize <Dummy>(); Assert.AreEqual(2, testList.Count); Assert.AreEqual(testLayer1.value, testList[0]); Assert.AreEqual(testLayer1.value + testLayer2.value, testList[1]); Assert.IsNotNull(realLayerData); Assert.AreEqual(testLayer1.value + testLayer2.value, realLayerData.string_value); }
public RenderingContext3DDX9(Control targetRenderArea, OutputRequirements oRequirements, OutputRequirements oMinReqs, CommonDeviceInterface cdi) { isDeviceLost = false; isActive = false; hasFocus = false; this.targetRenderArea = targetRenderArea; outReqs = oRequirements; outMinReqs = oMinReqs; log = cdi.GeneralLog; presentParams = new PresentParameters(); outCaps = cdi.DeviceCaps; layers = new LayerStack(); InitializeEnvironment(cdi); view3D = new RenderingView3DPer(Matrix.Identity, Matrix.Identity); }
public RenderingContext3DDX9(Control targetRenderArea, OutputRequirements oRequirements, OutputRequirements oMinReqs, CommonDeviceInterface cdi) { isDeviceLost = false; isActive = false; hasFocus = false; this.targetRenderArea = targetRenderArea; outReqs = oRequirements; outMinReqs = oMinReqs; log = cdi.GeneralLog; presentParams = new PresentParameters(); outCaps = cdi.DeviceCaps; layers = new LayerStack(); InitializeEnvironment(cdi); view3D = new RenderingView3DPer(Matrix.Identity, Matrix.Identity); }
public async Task GeneratedService_GeneratedProxy_Event_ClientLayerErrors() { var errorLayer = new TestLayer_ReturnErrors(); LayerStack <Dummy> clientLayerStack = new LayerStack <Dummy>(errorLayer); TestClientServer <DummyTestService> testClientServer = await SetupTestClientServer <DummyTestService>(null, clientLayerStack); var proxy = new DummyTestProxy <EpoxyConnection>(testClientServer.ClientConnection); var theEvent = new Dummy { int_value = 100 }; errorLayer.SetState(MessageType.Event, errorOnSend: true, errorOnReceive: false); ManualResetEventSlim waitForEvent = testClientServer.Service.CreateResetEvent(); proxy.EventMethodAsync(theEvent); bool wasSignaled = waitForEvent.Wait(TimeSpan.FromSeconds(1)); Assert.IsFalse(wasSignaled, "Event should not fire"); testClientServer.Service.ClearResetEvent(); Assert.AreEqual(0, testClientServer.Service.EventCount); Assert.AreEqual(Dummy.Empty.int_value, testClientServer.Service.LastEventReceived.int_value); errorLayer.SetState(MessageType.Event, errorOnSend: false, errorOnReceive: true); theEvent.int_value = 101; waitForEvent = testClientServer.Service.CreateResetEvent(); proxy.EventMethodAsync(theEvent); wasSignaled = waitForEvent.Wait(TimeSpan.FromSeconds(1)); Assert.IsTrue(wasSignaled, "Timed out waiting for event to fire"); Assert.AreEqual(1, testClientServer.Service.EventCount); Assert.AreEqual(theEvent.int_value, testClientServer.Service.LastEventReceived.int_value); await testClientServer.ServiceTransport.StopAsync(); await testClientServer.ClientTransport.StopAsync(); }
public LayerStackPresenter(LayerStackViewData layerData, ContextMenuViewData contextMenuData, LayerStack stack) { Assert.NotNull(layerData, nameof(layerData)); Assert.NotNull(contextMenuData, nameof(contextMenuData)); Assert.NotNull(stack, nameof(stack)); this.layerData = layerData; this.contextMenuData = contextMenuData; this.stack = stack; layerData.createLayerButton.onClick.AddListener(() => stack.CreateLayer()); layerData.createAffectorButton.onClick.AddListener(() => { if (activeLayer != null) { AddAffector(activeLayer); } }); stack.OnLayerCreate += OnLayerCreate; stack.OnLayerDelete += OnLayerDelete; }
public Shoelace(Veldrid.GraphicsBackend backend) : base(new WindowProps("Shoelace"), typeof(WindowsWindow), backend) { LayerStack.PushLayer(new EditorLayer()); }
public SandboxApp(Veldrid.GraphicsBackend backend) : base(typeof(WindowsWindow), backend) { LayerStack.PushLayer(new Sandbox2DLayer()); }
public RenderingContext3D(Control targetRenderArea, GraphicsProfile profile, CommonDeviceInterface cdi, HashTableSettings localSettings) { isDeviceLost = false; isActive = false; hasFocus = false; this.targetRenderArea = targetRenderArea; outProfile = profile; log = cdi.GeneralLog; presentParams = new PresentParameters(); outCaps = cdi.DeviceCaps; layers = new LayerStack(); InitializeEnvironment(cdi, localSettings); view3D = new RenderingView3DPer(Matrix.Identity, Matrix.Identity); view3D.Near = 0.1f; view3D.Far = 25; int sceneSize = 60; sManager = new GenericSceneManager<SceneEntity>(gDevice, outSettings, new Vector3(sceneSize / 2f, sceneSize / 2f, sceneSize / 2f), sceneSize); }