public override void Run(IGUI guiHandler) { _guiHandler = guiHandler ?? throw new ArgumentNullException(nameof(guiHandler)); _guiHandler.WriteMessage("All the numbers divisible by 3 and 5, from 1 to 100."); for (int i = 1; i <= 100; i++) { if (i % 3 == 0 && i % 5 == 0) { _guiHandler.WriteMessage(i.ToString()); } } _guiHandler.WriteMessage(""); _guiHandler.WriteMessage("All the numbers divisible by 3 or 5, from 1 to 100."); for (int i = 1; i <= 100; i++) { if (i % 3 == 0 || i % 5 == 0) { _guiHandler.WriteMessage(i.ToString()); } } _guiHandler.WriteMessage(""); _guiHandler.WriteMessage("The first 100 numbers that are divisible by 3 or 5."); for (int i = 1, c = 0; c <= 100; i++) { if (i % 3 == 0 || i % 5 == 0) { _guiHandler.WriteMessage($"{c++}: {i}"); } } }
public LinkView(IGUI _gui, NodeEditorPanel _editor, ConstellationScript _constellationScript, NodeConfig _nodeConfig, LinkRemoved _onLinkRemoved) { constellationScript = _constellationScript; editor = _editor; nodeConfig = _nodeConfig; OnLinkRemoved += _onLinkRemoved; }
public IGUI GUI() { IGUI res = this; GUILayout.BeginArea(new Rect(Screen.width * 0.2f, Screen.height * 0.2f, Screen.width * 0.6f, Screen.height * 0.6f)); GUILayout.BeginVertical(); if (GUILayout.Button("Revenir", Styles.ButtonNormal(20, Styles.Texte2), GUILayout.Width(Screen.width * 0.1f))) { res = new GUI_AcceuilCompetition(); } GUILayout.Space(Screen.height * 0.1f); _toggle = GUILayout.Toggle(_toggle, "Simuler les matchs", Styles.ToggleNormal(20, Styles.Texte1)); GUILayout.Space(Screen.height * 0.05f); if (GUILayout.Button("Valider", Styles.ButtonNormal(20, Styles.Texte2), GUILayout.Width(Screen.width * 0.1f))) { Session.Instance.Partie.Options.SimulerMatchs = _toggle; res = new GUI_AcceuilCompetition(); } GUILayout.EndVertical(); GUILayout.EndArea(); return(res); }
public void AddEvents(IGUI gui) { OnHealthChange += gui.SetHealtValue; OnManaChange += gui.SetManaValue; OnExperienceChange += gui.SetExperienceValue; OnLevelChange += gui.SetLevelValue; }
public static void Remove(IGUI gUI) { if (gUIs.Contains(gUI)) { gUIs.Remove(gUI); } }
public override void Run(IGUI guiHandler) { _guiHandler = guiHandler ?? throw new ArgumentNullException(nameof(guiHandler)); _guiHandler.WriteMessage("Create 3 strings, then print their concatenations forward and backward"); List <string> strings = new List <string>(); strings.Add("Io"); strings.Add("Sono"); strings.Add("TuoPadre"); string strOut = ""; for (int i = 0; i < strings.Count; i++) { strOut = String.Concat(strOut, strings[i]); } _guiHandler.WriteMessage(strOut); strOut = ""; for (int i = strings.Count - 1; i >= 0; i--) { strOut = String.Concat(strOut, strings[i]); } _guiHandler.WriteMessage(strOut); }
public NodeEditorNodes(EditorWindow _editorWindow, NodeConfig _nodeConfig, ConstellationScript _constellationScript, IUndoable _undoable, NodeEditorSelection _nodeEditorSelection, ILinkEditor _linkEditor, IGUI _gui, IVisibleObject _visibleObject, NodeAdded _nodeAdded, NodeRemoved _nodeRemoved, HelpClicked _helpClicked) { linkEditor = _linkEditor; editorWindow = _editorWindow; Nodes = new List <NodeView> (); nodeConfig = _nodeConfig; constellationScript = _constellationScript; isInstance = constellationScript.IsInstance; nodesFactory = new NodesFactory(); undoable = _undoable; nodeEditorSelection = _nodeEditorSelection; GUI = _gui; visibleObject = _visibleObject; OnNodeAdded += _nodeAdded; OnNodeRemoved += _nodeRemoved; OnHelpClicked += _helpClicked; SetNodes(); }
public static void Add(IGUI gUI) { if (!gUIs.Contains(gUI)) { gUIs.Add(gUI); } }
public NodeEditorPanel(IGUI _gui, EditorWindow _editorWindow, ConstellationScript _script, IUndoable _undoable, ClipBoard _editorClipBoard, float positionX, float positionY, LinkAdded linkAdded, NodeAdded nodeAdded, NodeRemoved nodeRemoved) { nodesFactory = new NodesFactory(); constellationScript = _script; undoable = _undoable; Nodes = new List <NodeView> (); GUI = _gui; EditorWindow = _editorWindow; editorScrollSize = new Vector2(500, 500); Background = AssetDatabase.LoadAssetAtPath(editorPath + "background.png", typeof(Texture2D)) as Texture2D; var allNodes = NodesFactory.GetAllNodes(); nodes = new string[allNodes.Length]; editorScrollPos = new Vector2(positionX, positionY); for (var i = 0; i < allNodes.Length; i++) { nodes[i] = allNodes[i]; } OnLinkAdded += linkAdded; OnNodeAdded += nodeAdded; OnNodeRemoved += nodeRemoved; nodeEditorSelection = new NodeEditorSelection(GUI, _editorClipBoard); }
private static void StartGUIModule() { // Create GUI module GUIModuleName = Settings["GUI"]; switch (GUIModuleName.ToLower()) { case "winform": GUIModuleName = "WinForm"; GUIModule = new GUI.WinForm.ProcessPanel(); break; case "service": GUIModuleName = "Service"; GUIModule = new Service(); break; case "tcpd": GUIModuleName = "TCPD"; GUIModule = new TCPD(); break; case "console": default: GUIModuleName = "Console"; GUIModule = new GUI.Console.Console(); break; } m_log.Info("GUI type: " + GUIModuleName); }
public override void Run(IGUI guiHandler) { _guiHandler = guiHandler ?? throw new ArgumentNullException(nameof(guiHandler)); _guiHandler.WriteMessage("All the numbers between 1 and 100"); for (int i = 1; i <= 100; i++) { if (i % 3 == 0 && i % 5 == 0) { _guiHandler.WriteMessage("fizzbuzz"); } else if (i % 3 == 0) { _guiHandler.WriteMessage("fizz"); } else if (i % 5 == 0) { _guiHandler.WriteMessage("buzz"); } else { _guiHandler.WriteMessage($"{i}"); } } }
public NodeEditorSelection(IGUI gui, ClipBoard clipBoard) { SelectedNodes = new List <NodeView> (); StartMousePosition = Vector2.zero; DragSize = Vector2.zero; GUI = gui; }
public override void Run(IGUI guiHandler) { _guiHandler = guiHandler ?? throw new ArgumentNullException(nameof(guiHandler)); _guiHandler.WriteMessage($"#### {Description} ####"); _guiHandler.WriteMessage("As we all know, the answer to all the quesions is 42"); }
public Root(IGUI gui, Zahlenwerk zw, Berechnen berechnen) { gui.Zifferneingabe += zw.Zifferneingabe; gui.Rechenschritt_ausführen += zw.Zahl_entnehmen; zw.Zahl_entnommen += berechnen.Process; berechnen.Result += zw.Zahl_setzen; zw.Aktualisierte_Zahl += gui.Ergebnis_anzeigen; }
private void SliderLKW_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e) { int lkw = (int)SliderLKW.Value; IGUI myInterface = th; myInterface.updateTruckRatio(lkw); Console.WriteLine("Slider LKWs: " + lkw); }
private void SliderNum_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e) { int num = (int)SliderNum.Value; IGUI myInterface = th; myInterface.updateCarAmount(num); Console.WriteLine("Slider Anzahl: " + num); }
private void Start() { //Démarrage : menu principal _gui = new GUI_MenuPrincipal(); if (_demarrage != null) { _gui = _demarrage; } }
void Start() { LoadKeys(); gui = graphicalUserIterface.GetComponent <IGUI>(); gui.SetMaxAmmoValue(0); gui.UpdateAmmoDisplay(0); flashLight.SetActive(false); //TODO load later on (from playerprefs or whatever) holsterLock = false; //TODO also load }
// Use this for initialization void Start() { craftingDisplay = GameObject.Find("CraftingGUI").GetComponent<CraftingGUI>(); craftingDisplay.enabled = false; inventoryDisplay = GameObject.Find("InventoryGUI").GetComponent<IGUI>(); inventoryDisplay.enabled = false; openCloseGUIs = GameObject.Find("GUIButtons").GetComponent<OpenCloseGUIs>(); }
public ClassDpCommunication(string portName, int baud, DpIncomingInformation info, IGUI gui) { IncomingCommunicationBufferHandlerThread = new Thread(ApiTask); SerialPortInstanse = new classSerial(portName, 115200, null); incomingInfo = info; IncomingCommunicationBufferHandlerThread.IsBackground = false; IncomingCommunicationBufferHandlerThread.Start(); _gui = gui; }
public override void Run(IGUI guiHandler) { _guiHandler = guiHandler ?? throw new ArgumentNullException(nameof(guiHandler)); int myValue = 42; _guiHandler.WriteMessage($"La risposta a tutte le domande è: {myValue}"); _guiHandler.WriteMessage($"Il suo doppio è: {myValue * 2}"); _guiHandler.WriteMessage($"Il suo triplo è: {myValue * 3}"); }
void Start() { AddSelfToPlayerPrefObserverList(); LoadKeys(); LoadValues(); gui = guiObject.GetComponent <IGUI>(); movement.Initialize(this, rb, worldCollider, head, health); view.Initialize(this, rb, head); health.Initialize(rb, head); paused = false; //instead of this maybe GET it from somewhere }
public EvolutionaryProcess(IGUI _program, string _problem) { program = _program; problem = _problem; IndividualFactory.getInstance().Init(problem); population = new List <Individual>(); for (int i = 0; i < Parameters.individualsNb; i++) { population.Add(IndividualFactory.getInstance().getIndividual (problem)); } }
void Start() { health = 100f; //TODO load these values from playerprefs later on armor = 0f; fallDamageMinVel = Mathf.Sqrt(2 * normalGravity * fallDamageMinHeight); fallDamageMaxVel = Mathf.Sqrt(2 * normalGravity * fallDamageMaxHeight); gui = graphicalUserInterface.GetComponent <IGUI>(); gui.SetMaxHealthValue(maxHealth); gui.SetMaxArmorValue(maxArmor); gui.UpdatePlayerHealthDisplay(health); gui.UpdatePlayerArmorDisplay(armor); }
private void Awake() { main = this; iGUI = gameObject.GetComponent <IGUI>(); iGUI.WakeUp(); CreateWindows(); CreateGroups(); }
void Start() { mGui = guiMain; mKeyboardInput = kbInput; mPlayer = player; mBullet = bullet; mPlayer.BulletRefresh(mBullet); mPlayerCtrl = new PlayerCtrl(mPlayer, camera, Setting.PLAYER_SPEED); mEngine = new Engine(); mKeyboardInput.Init(mPlayerCtrl); mGui.Init(mPlayerCtrl, mEngine); }
static void ConfigureApplication(string t) { IGUI ui = t switch { "win" => new WinGUI(), "mac" => new MacGUI(), _ => null }; Application app = new Application(ui); app.CreateUI(); app.Render(); }
public override void Run(IGUI guiHandler) { guiHandler.PrintList(MockList, "Starting list"); guiHandler.WriteMessage(); #region Extensions example guiHandler.PrintList(MockList.ToRevertedStrings(), "Reverted elements list"); guiHandler.WriteMessage(); guiHandler.PrintList(MockList.ToLengthList(), "Elements length list"); guiHandler.WriteMessage(); guiHandler.PrintList(MockList.LessThanLength(3), "Elements shorter than 3"); guiHandler.WriteMessage(); guiHandler.PrintList(MockList.StartWithLetter('a'), "Elements beginning with a"); guiHandler.WriteMessage(); guiHandler.PrintList(MockList.IsConvertibleInInt(), "Elements convertible in int"); guiHandler.WriteMessage(); #endregion Extensions example #region Interface example guiHandler.WriteMessage("WITH INTERFACE"); guiHandler.PrintList(MockList.Filter(new ShortStringFilter(3)), "Elements shorter than 3"); guiHandler.WriteMessage(); guiHandler.PrintList(MockList.Filter(new StartWithFilter('a')), "Elements beginning with a"); guiHandler.WriteMessage(); guiHandler.PrintList(MockList.Filter(new StringConvertibleToInt_Filter()), "Elements convertible in int"); guiHandler.WriteMessage(); guiHandler.PrintList(MockList.Project(new LenghtFromString_Projection()), "Elements length list"); guiHandler.WriteMessage(); guiHandler.PrintList(MockList.Project(new InvertedString_Projection()), "Reverted elements list"); guiHandler.WriteMessage(); #endregion Interface example #region Delegate example guiHandler.WriteMessage("WITH DELEGATES"); guiHandler.PrintList(MockList.FilterBy(x => x != null && x.Length < 3), "Elements shorter than 3"); guiHandler.WriteMessage(); guiHandler.PrintList(MockList.FilterBy(x => x != null && (x.StartsWith("A") || x.StartsWith("a"))), "Elements beginning with a"); guiHandler.WriteMessage(); guiHandler.PrintList(MockList.FilterBy(x => x != null && int.TryParse(x, out int _)), "Elements convertible in int"); guiHandler.WriteMessage(); //guiHandler.PrintList(MockList.Project(new LenghtFromString_Projection()), "Elements length list"); //guiHandler.WriteMessage(); //guiHandler.PrintList(MockList.Project(new InvertedString_Projection()), "Reverted elements list"); //guiHandler.WriteMessage(); #endregion Delegate example guiHandler.AskForExit(); }
void Start() { AddSelfToPlayerPrefObserverList(); LoadValues(); LoadKeys(); layermaskInteract = GetLayerMask(LayerMask.NameToLayer("InteractCast")); layermaskProp = GetLayerMask(LayerMask.NameToLayer("Prop")); layerWater = LayerMask.NameToLayer("Water"); interactTestInterval = 1f / interactTestsPerSecond; interactTestTimer = 0f; gui = graphicalUserInterface.GetComponent <IGUI>(); InitializeGrabbedObjectSmoothingArrays(); Cursor.lockState = CursorLockMode.Locked; }
internal static void Shutdown() { // Stop the processes stopProcesses(); lock (startStopLock) { // Stop GUI module if (GUIModule != null) { GUIModule.StopGUI(); GUIModule = null; } } }
public override void Run(IGUI guiHandler) { _guiHandler = guiHandler ?? throw new ArgumentNullException(nameof(guiHandler)); _guiHandler.WriteMessage("Read 2 numbers from the Console, then print on the Console all the 5 integer operations ( \"a + b\", \"a - b\", etc) with the results of the operations."); int a = _guiHandler.AskForPositiveInt("Inserisci un numero intero A:"); int b = _guiHandler.AskForPositiveInt("Inserisci un numero intero B:"); _guiHandler.WriteMessage($"Somma (a+b): {a + b}"); _guiHandler.WriteMessage($"Sottrazione (a-b): {a - b}"); _guiHandler.WriteMessage($"Moltiplicazione (a*b): {a * b}"); _guiHandler.WriteMessage($"Divisione (a:b): {a / b}"); _guiHandler.WriteMessage($"Modulo (a%b): {a % b}"); }
public override void Run(IGUI guiHandler) { _guiHandler = guiHandler ?? throw new ArgumentNullException(nameof(guiHandler)); _guiHandler.WriteMessage("Read 2 numbers from the Console (giving good input messages to the user), and print all the 5 integer operations in a \"decorated way\""); int a = _guiHandler.AskForPositiveInt("Inserisci un numero intero A:"); int b = _guiHandler.AskForPositiveInt("Inserisci un numero intero B:"); _guiHandler.WriteMessage($"Somma (a+b): {a + b}"); _guiHandler.WriteMessage($"Sottrazione (a-b): {a - b}"); _guiHandler.WriteMessage($"Moltiplicazione (a*b): {a * b}"); _guiHandler.WriteMessage($"Divisione (a:b): {a / b}"); _guiHandler.WriteMessage($"Modulo (a%b): {a % b}"); }
public GraphicsWindow(IMessageBus bus, IObservableTimer timer, IGUI gui, IAssets assets, IProfiler profiler, ICamera camera) : base(1280, 720, new GraphicsMode(32, 0, 0, 4), "Sharp Engine") { _profiler = profiler; _camera = camera; _profile = _profiler.Profile("Graphics"); _timer = timer; _gui = gui; Bus = bus; Views = new ConcurrentDictionary<Guid, IGameObjectView>(); SetupGUI(); _assets = assets; foreach (var viewtype in AppDomain.CurrentDomain.GetAssemblies().ToList().SelectMany(s => s.GetTypes()).Where(p => typeof(IGameObjectView).IsAssignableFrom(p) && p.IsClass && p.IsDefined(typeof(BindViewAttribute), false)).ToList()) { var bindViewAttribute = viewtype.GetCustomAttributes(typeof(BindViewAttribute), true).Cast<BindViewAttribute>().FirstOrDefault(); if (bindViewAttribute != null) _availableViews.Add(bindViewAttribute.GameObjectType, viewtype); } Bus.OfType<GameObjectCreated>().Subscribe(OnGameObjectCreated); }
public void DeleteButton(IGUI button) { (button as GuiElement).deleteFlag = true; //mark for clean up in the next gui phase. }
static void Main() { /* So much as for "It's very easy to figure out if we're running on a x64 or x86 platform" ;-) */ //bIs64Bit = (IntPtr.Size == 8); /** * Get our music / media folder from the settings, or if set to "default", get it from Windows * */ if (Crossfade.Properties.Settings.Default.MusicFolder == "default") { MusicPath = Environment.GetFolderPath(Environment.SpecialFolder.MyMusic); } else { MusicPath = Crossfade.Properties.Settings.Default.MusicFolder; } /** * Unfortunately, x64 support is not included at this time, because our support libraries (dnssd / fmod / directx) * don't support it, so we have to compile for x86 platform instead of "Any CPU". * */ /*if (!File.Exists("fmodex32.dll") || !File.Exists("fmodex64.dll")) throw new FileNotFoundException("fmodex32/64.dll not found!"); if (File.Exists("fmodex.dll")) File.Delete("fmodex.dll"); if (bIs64Bit) File.Copy("fmodex64.dll", "fmodex.dll"); else File.Copy("fmodex32.dll", "fmodex.dll");*/ Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); /** * Create the SYSTRAY-ICON * */ NotifyIcon trayicon = new NotifyIcon(); trayicon.Text = "CrossFade"; trayicon.Icon = Crossfade.Properties.Resources.systray; trayicon.Visible = true; trayicon.DoubleClick += new EventHandler(trayicon_DoubleClick); ContextMenu ctxmenu = new ContextMenu(); ctxmenu.MenuItems.Add(new MenuItem("&Play", new EventHandler(onPlay))); ctxmenu.MenuItems.Add(new MenuItem("&Stop", new EventHandler(onStop))); ctxmenu.MenuItems.Add(new MenuItem("&Pause", new EventHandler(onPause))); ctxmenu.MenuItems.Add(new MenuItem("&Previous", new EventHandler(onPrev))); ctxmenu.MenuItems.Add(new MenuItem("&Next", new EventHandler(onNext))); ctxmenu.MenuItems.Add(new MenuItem("&Quit", new EventHandler(onQuit))); trayicon.ContextMenu = ctxmenu; /** * Show the splash screen * */ gui_SplashScreen.ShowSplashScreen(); // Create AppDomainSetup //string exeAssembly = Assembly.GetEntryAssembly().FullName; //AppDomainSetup ads = new AppDomainSetup(); //ads.ApplicationBase = System.Environment.CurrentDirectory; //ads.DisallowBindingRedirects = false; //ads.DisallowCodeDownload = true; //ads.ConfigurationFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile; //// Create Untrusted Zone //Evidence secInfo = new Evidence(); //secInfo.AddHost(new Zone(SecurityZone.Untrusted)); //Evidence secInfo = null; //// Create Webserver Context //AppDomain ad = AppDomain.CreateDomain("Webserver", secInfo, ads); //HTTPServer serv = (HTTPServer)ad.CreateInstanceAndUnwrap(exeAssembly, typeof(HTTPServer).FullName); //serv.Start(MusicPath); serv = null; try { gui_SplashScreen.SetProgressBar(5); /** * Initialize the Player Singleton * */ gui_SplashScreen.SetStatus("Creating player ..."); Player.Instance.bootstrap(); gui_SplashScreen.SetProgressBar(50); /** * Initialize the Media Database Singleton and commit it * */ gui_SplashScreen.SetStatus("Creating media library ..."); MediaDB.Instance.bootstrap(); MediaDB.Instance.commit(); gui_SplashScreen.SetProgressBar(50); /** * Initialize the Playlist Singleton * */ gui_SplashScreen.SetStatus("Creating playlist ..."); Playlist.Instance.bootstrap(); gui_SplashScreen.SetProgressBar(50); /** * Initialize our GUI * */ gui_SplashScreen.SetStatus("Loading GUI ..."); gui = (IGUI)(new gui_krypton()); gui_SplashScreen.SetProgressBar(50); /** * Initialize the Peer-to-Peer Filesharing Singleton * */ gui_SplashScreen.SetStatus("Creating Peer2Peer-Service ..."); serv = new HTTPServer(); serv.Start(MusicPath); P2PDB.Instance.start(); gui_SplashScreen.SetProgressBar(-1); Application.Run((Form)gui); } finally { P2PDB.Instance.stop(); if (serv != null) serv.Stop(); //AppDomain.Unload(ad); } }
public void AddGui(IGUI gui) { elements.Add(gui); }