private void ListBox_Drop(object sender, DragEventArgs e) { if (sender != dragSource) { JIRAItemViewModel data = (JIRAItemViewModel)e.Data.GetData(typeof(JIRAItemViewModel)); if (boardName.Order == FirstBoardOrder) { data.Data.BoardId = null; data.Data.DoneDate = null; } else if (boardName.Order == LastBoardOrder) { data.Data.DoneDate = DateTime.Now; data.Data.BoardId = null; } else { data.Data.BoardId = boardName.ID; data.Data.DoneDate = null; } //TODO: Update DAO AppStateManager.DataStore.UpsertJIRA(data.Data); //Update UI AppStateManager.RefreshBoards(); } dragSource = null; }
void Awake() { appStateManager = FindObjectOfType <AppStateManager>(); generalConfiguration = FindObjectOfType <GeneralConfiguration>(); arRaycastManager = FindObjectOfType <ARRaycastManager>(); placementCursor = Instantiate(generalConfiguration.placementCursorPrefab) as GameObject; }
private GameObject currentlyMovingObject = null; //when a piece of scenery is being moved, it is referenced to this variable - otherwise, it is normally left null void Awake() { arCamera = Camera.main; appStateManager = FindObjectOfType <AppStateManager>(); generalConfiguration = FindObjectOfType <GeneralConfiguration>(); sceneryUtil = FindObjectOfType <SceneryUtil>(); }
public void startDemo() { AdvancedMogreFramework amf = new AdvancedMogreFramework(); if (!AdvancedMogreFramework.Singleton.initOgre("AdvancedMogreFramework")) { return; } AdvancedMogreFramework.Singleton.m_pLog.LogMessage("Demo initialized!"); m_pAppStateManager = new AppStateManager(); AppState.create <MenuState>(m_pAppStateManager, "MenuState"); AppState.create <GameState>(m_pAppStateManager, "GameState"); AppState.create <SinbadState>(m_pAppStateManager, "SinbadState"); AppState.create <PauseState>(m_pAppStateManager, "PauseState"); AppState.create <CreditState>(m_pAppStateManager, "CreditState"); AppState.create <PhysxBasicCubeState>(m_pAppStateManager, "BasicCubeState"); AppState.create <PhysxCharacterControllerState>(m_pAppStateManager, "CharacterControllerState"); AppState.create <PhysxClothState>(m_pAppStateManager, "ClothState"); AppState.create <PhysxNewtonCradleState>(m_pAppStateManager, "NewtonCradleState"); m_pAppStateManager.start(m_pAppStateManager.findByName("MenuState")); }
private Text uiLogOutputText; //UI Textbox used to display debugging info directly on the device screen. void Awake() { appStateManager = FindObjectOfType <AppStateManager>(); appAnchorManager = FindObjectOfType <CloudAnchorSessionManager>(); sceneryPlacementManager = FindObjectOfType <SceneryPlacementManager>(); sceneryPersistenceManager = FindObjectOfType <SceneryPersistenceManager>(); uiContentObject = GameObject.Find("/UICanvas/Panel/UIContent"); uiLogOutputObject = uiContentObject.transform.Find("UILogOutput").gameObject; uiLogOutputText = uiLogOutputObject.GetComponent <Text>(); uiButtonSetAnchorObject = uiContentObject.transform.Find("UIButton_SetAnchor").gameObject; uiButtonRestoreAnchorObject = uiContentObject.transform.Find("UIButton_RestoreAnchor").gameObject; uiButtonPlaceSceneryObject = uiContentObject.transform.Find("UIButton_PlaceScenery").gameObject; uiButtonMoveSceneryObject = uiContentObject.transform.Find("UIButton_MoveScenery").gameObject; uiButtonSaveSceneryObject = uiContentObject.transform.Find("UIButton_SaveScenery").gameObject; uiButtonRestoreSceneryObject = uiContentObject.transform.Find("UIButton_RestoreScenery").gameObject; uiButtonSetAnchorObject.GetComponent <Button>().onClick.AddListener(delegate { UIButton_SetAnchor_Click(); }); uiButtonRestoreAnchorObject.GetComponent <Button>().onClick.AddListener(delegate { UIButton_RestoreAnchor_Click(); }); uiButtonPlaceSceneryObject.GetComponent <Button>().onClick.AddListener(delegate { UIButton_PlaceScenery_Click(); }); uiButtonMoveSceneryObject.GetComponent <Button>().onClick.AddListener(delegate { UIButton_MoveScenery_Click(); }); uiButtonSaveSceneryObject.GetComponent <Button>().onClick.AddListener(delegate { UIButton_SaveScenery_Click(); }); uiButtonRestoreSceneryObject.GetComponent <Button>().onClick.AddListener(delegate { UIButton_RestoreScenery_Click(); }); }
protected override void Draw(GameTime GameTime) { AppStateManager.UpdatePreRender(GameTime); GraphicsDevice.Clear(Color.CornflowerBlue); RenderManager.Update(GameTime); base.Draw(GameTime); }
void Awake() { appStateManager = FindObjectOfType <AppStateManager>(); generalConfiguration = FindObjectOfType <GeneralConfiguration>(); spatialAnchorManager = FindObjectOfType <SpatialAnchorManager>(); SetupCloudSessionAsync(); }
public Manager() { Configure(out _mailConfiguration); _appStateManager = new AppStateManager(); _downloader = new WebpageDownloader(); _changesChecker = new ChangesChecker(_downloader, _mailConfiguration); }
public App() { Microsoft.ApplicationInsights.WindowsAppInitializer.InitializeAsync( Microsoft.ApplicationInsights.WindowsCollectors.Metadata | Microsoft.ApplicationInsights.WindowsCollectors.Session); this.InitializeComponent(); AppStateManager appStateManager = new AppStateManager(this); }
public ActionResult Results() { var ResultsViewModel = new ResultsViewModel(); ResultsViewModel.Results = new List <VoteResult>(); var state = AppStateManager.GetState(); var Votes = state.Votes.Where(j => j.Timestamp >= DateTime.Today); if (Votes.Count() == 0) { ResultsViewModel.Winner = PickRandom(state.Restaurants); ResultsViewModel.TieBreaker = ResultsViewModel.Winner; return(View(ResultsViewModel)); } //show what current user voted for. if (Votes.Any(i => i.Username == Request["LOGON_USER"])) { ResultsViewModel.YourVote = Votes.First(i => i.Username == Request["LOGON_USER"]); } //make list of result tallies foreach (var k in state.Restaurants) { ResultsViewModel.Results.Add(new VoteResult { Count = 0, Restaurant = k }); } //fill with votes foreach (var k in Votes) { var result = ResultsViewModel.Results.First(j => j.Restaurant.ID == k.Restaurant.ID); result.Count++; } //remove tallies with 0 votes. ResultsViewModel.Results.RemoveAll(i => i.Count == 0); //if there's a tie for first, figure out how many tied. var WinCount = ResultsViewModel.Results.OrderByDescending(j => j.Count).First().Count; var WinTies = (from j in ResultsViewModel.Results where j.Count == WinCount select j.Restaurant).ToList(); //then pick randomly from the ties. if (WinTies.Count() > 1) { ResultsViewModel.Winner = PickRandom(WinTies); ResultsViewModel.TieBreaker = ResultsViewModel.Winner; return(View(ResultsViewModel)); } //If there's a clear winner, return it. ResultsViewModel.Winner = WinTies.First(); ResultsViewModel.TieBreaker = null; return(View(ResultsViewModel)); }
//Singleton design pattern void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); } }
private void TryLoad() { try { AppStateManager.Initialize(mainWindow); } catch (Exception e) { MessageBoxFactory.ShowError(e, "Loading Error"); } }
// Use this for initialization void Awake () { if (theOne == null) { theOne = this; } else { DestroyImmediate(this); } changeStateId(currentStateId); }
public ActionResult Index() { var state = AppStateManager.GetState(); var VotesToday = state.Votes.Where(i => i.Timestamp >= DateTime.Today); //if (VotesToday.Any(i => i.Username == Request["LOGON_USER"])) //{ // return RedirectToAction("Results"); //} return(View(state.Restaurants.OrderBy(i => i.Name))); }
// Use this for initialization void Awake() { currentStateId = stateComponents[0].id; Debug.Log(currentStateId); if (theOne == null) { theOne = this; } else { DestroyImmediate(this); } changeState(currentStateId); }
public App() { this.InitializeComponent(); StateManager = new AppStateManager(); //アプリの状態とその最小幅を定義する StateManager.StateList.Add(AppState.Mobile, 0); StateManager.StateList.Add(AppState.Normal, 600); StateManager.StateList.Add(AppState.Wide, 1200); OnChangeAppState += (s, s2) => { }; //アプリのライフサイクルをフック App.Current.Resuming += App_Resuming; App.Current.Suspending += App_Suspending; }
private bool InitSubSystem(GameConfigXml gameOptions) { appStateMgr = new AppStateManager(); locateMgr = LocateSystem.Instance; modMgr = new ModManager(); outputMgr = new OutputManager(); soundMgr = new MusicSoundManager(); uiMgr = new ScreenManager(); MusicSoundManager.Instance.InitSystem( gameOptions.AudioConfig.EnableMusic, gameOptions.AudioConfig.EnableSound ); return(true); }
public ActionResult Vote(int id) { var Username = Request["LOGON_USER"]; var state = AppStateManager.GetState(); if (!state.Restaurants.Any(i => i.ID == id)) { throw new Exception("No state found with that ID."); } if (state.Votes.Any(i => i.Timestamp >= DateTime.Today && i.Username == Username)) { return(RedirectToAction("Results")); } state.Vote(id); AppStateManager.SaveState(state); return(RedirectToAction("Results")); }
public GameManager() { root = null; renderWindow = null; viewport = null; log = null; timer = null; inputMgr = null; keyboard = null; mouse = null; appStateMgr = null; soundMgr = null; VideoMode = new NameValuePairList(); isEditMode = false; isCheatMode = false; loadingData = new LoadingData(LoadingType.NONE, null, null, null); GlobalValueTable = new Dictionary <string, object>(); }
private bool InitSubSystem(Dictionary <string, string> gameOptions) { appStateMgr = new AppStateManager(); locateMgr = LocateSystem.Singleton; modMgr = new ModManager(); networkMgr = new NetworkManager(); outputMgr = new OutputManager(); soundMgr = new SoundManager(); uiMgr = new ScreenManager(); SoundManager.Instance.InitSystem(gameOptions["EnableMusic"] == "True" ? true : false, gameOptions["EnableSound"] == "True" ? true : false); Update += modMgr.Update; Update += outputMgr.Update; Update += soundMgr.Update; Update += uiMgr.Update; return(true); }
protected override void Initialize() { GameState = GameStates.MainMenu; AppStateManager = new AppStateManager(this); RenderManager = new RenderManager(Content, Graphics.GraphicsDevice); InputManager = new InputManager(this); MenuManager = new MenuManager(RenderManager.GuiNode, InputManager, this); AppStateManager.Attach(InputManager); AppStateManager.Attach(MenuManager); Graphics.PreparingDeviceSettings += (object s, PreparingDeviceSettingsEventArgs args) => { args.GraphicsDeviceInformation.PresentationParameters.RenderTargetUsage = RenderTargetUsage.PreserveContents; }; Graphics.ApplyChanges(); base.Initialize(); }
void Awake() { // If the instance reference has not been set, yet, if (instance == null) { // Set this instance as the instance reference. instance = this; } else if (instance != this) { // If the instance reference has already been set, and this is not the // the instance reference, destroy this game object. Destroy(gameObject); } // Do not destroy this object, when we load a new scene. DontDestroyOnLoad(gameObject); print(instance.projects[0]); instance.activeProject = projects[0]; }
public GameManager() { root = null; renderWindow = null; viewport = null; log = null; timer = null; inputMgr = null; keyboard = null; mouse = null; trayMgr = null; appStateMgr = null; soundMgr = null; AllGameObjects = new Dictionary <int, GameObject>(); GameHashMap = new Dictionary <string, uint>(); videoMode = new NameValuePairList(); isEditMode = false; isCheatMode = false; loadingData = new LoadingData(LoadingType.NONE, null, null, null); }
public void startDemo() { AdvancedMogreFramework amf = new AdvancedMogreFramework(); if (!AdvancedMogreFramework.Singleton.initOgre("AdvancedMogreFramework")) { return; } AdvancedMogreFramework.Singleton.m_pLog.LogMessage("Demo initialized!"); m_pAppStateManager = new AppStateManager(); AppState.create <MenuState>(m_pAppStateManager, "MenuState"); AppState.create <GameState>(m_pAppStateManager, "GameState"); AppState.create <SinbadState>(m_pAppStateManager, "SinbadState"); AppState.create <PauseState>(m_pAppStateManager, "PauseState"); AppState.create <CreditState>(m_pAppStateManager, "CreditState"); m_pAppStateManager.start(m_pAppStateManager.findByName("MenuState")); }
void Start() { appStateManager = AppStateManager.stateManager; }
void Start() { appStateManager = FindObjectOfType <AppStateManager>(); generalConfiguration = FindObjectOfType <GeneralConfiguration>(); }
protected override void Update(GameTime gameTime) { AppStateManager.Update(gameTime); base.Update(gameTime); }
private void Page_Load(object sender, System.EventArgs e) { if (StateManager.IsManualState()) { // If the StateManager doesn't exist in the session put it else get it. if (StateManager.GetStateManagerFromSession() == null) { //instanciate AppStateManager class AppStateManager myStateManager = new AppStateManager(); //put state manager to session StateManager.PutStateManagerInSession(myStateManager); //put current map alias to state manager dictionary myStateManager.ParamsDictionary[StateManager.ActiveMapAliasKey] = this.MapControl1.MapAlias; } // Now Restore State StateManager.GetStateManagerFromSession().RestoreState(); } if (!Page.IsPostBack) { #region 加载节点地图数据 Map mainMap = GetMap(); FeatureLayer flStation = mainMap.Layers["Station"] as FeatureLayer; FeatureLayer flBaseStation = mainMap.Layers["BaseStation"] as FeatureLayer; FeatureLayer flSubMachine = mainMap.Layers["SubMachine"] as FeatureLayer; //加载主站 foreach (Feature fStation in (flStation.Table as MapInfo.Data.ITableFeatureCollection)) { TreeNode tn = new TreeNode(fStation["NAME"].ToString()); tn.Target = fStation["ID"].ToString(); tn.ImageUrl = Request.MapPath("~/images/1.gif"); tn.CollapseAll(); TreeView2.Nodes.Add(tn); } //加载基站 foreach (Feature fBaseStation in (flBaseStation.Table as MapInfo.Data.ITableFeatureCollection)) { TreeNode pNode = GetParentStation(fBaseStation["PID"].ToString()); if (pNode == null) { continue; } TreeNode tn = new TreeNode(fBaseStation["NAME"].ToString()); tn.Target = fBaseStation["ID"].ToString(); tn.ImageUrl = Request.MapPath("~/images/2.gif"); tn.CollapseAll(); pNode.ChildNodes.Add(tn); } //加载子机 foreach (Feature fSubMachine in (flSubMachine.Table as MapInfo.Data.ITableFeatureCollection)) { TreeNode pNode = GetBaseStation(fSubMachine["PID"].ToString()); if (pNode == null) { continue; } TreeNode tn = new TreeNode(fSubMachine["NAME"].ToString()); tn.Target = fSubMachine["ID"].ToString(); tn.ImageUrl = Request.MapPath("~/images/3.gif"); tn.CollapseAll(); pNode.ChildNodes.Add(tn); } TreeView2.ExpandAll(); #endregion } }
private void BindManager(AppStateManager stateManager) { _stateManager = stateManager; }
public void ChangeGameState(string GameStateName) { bool HasMenuState = false; for (int i = 0; i < Enum.GetNames(typeof(GameStates)).Length; i++) { if (GameStateName.Contains(Enum.GetNames(typeof(GameStates))[i].ToString())) { GameState = (GameStates)Enum.Parse(typeof(GameStates), Enum.GetNames(typeof(GameStates))[i]); HasMenuState = true; break; } } if (!HasMenuState) { return; } if (GameStateName == "Exit") { this.Exit(); } /* * if (GameStateName.Contains("GamePlay") && GamePlayManager == null) * { * GamePlayManager = new GamePlayManager(this, RenderManager, InputManager, MenuManager); * AppStateManager.Attach(GamePlayManager); * } * else if (GameStateName == "MapEditor" && MapEditorManager == null) * { * MapEditorManager = new MapEditorManager(MenuManager.CurrentMenuContainer, InputManager); * AppStateManager.Attach(MapEditorManager); * } * else if (GameStateName == "StructureModelEditor" && StructureModelEditor == null) * { * StructureModelEditor = new StructureModelEditor(this, RenderManager, MenuManager.CurrentMenuContainer, InputManager); * AppStateManager.Attach(StructureModelEditor); * } * else if (GameStateName == "MainMenu") * { * if (GamePlayManager != null) * { * //GamePlayManager.Close(); * AppStateManager.Detach(GamePlayManager); * GamePlayManager = null; * } * if (MapEditorManager != null) * { * //MapEditorManager.Close(); * AppStateManager.Detach(MapEditorManager); * MapEditorManager = null; * } * if (StructureModelEditor != null) * { * StructureModelEditor.Close(); * AppStateManager.Detach(StructureModelEditor); * StructureModelEditor = null; * } * if (PatternEditor != null) * { * PatternEditor.Close(); * AppStateManager.Detach(PatternEditor); * PatternEditor = null; * } * if (WorldEditorManager != null) * { * WorldEditorManager.Close(); * AppStateManager.Detach(WorldEditorManager); * WorldEditorManager = null; * } * } * else if ( GameStateName == "VoxelPatternEditor") * { * PatternEditor = new VoxelPatternEditor(MenuManager.CurrentMenuContainer, RenderManager, InputManager); * AppStateManager.Attach(PatternEditor); * } */ if (GameStateName == "WorldTerrainEditor") { WorldEditorManager = new WorldTerrainEditor(this, RenderManager, MenuManager, MenuManager.CurrentMenuContainer, InputManager); AppStateManager.Attach(WorldEditorManager); } }
public AppStateManagerTests() { _appStateManager = new AppStateManager(); }
// Use this for initialization void Start() { FindAllTools(); stateManager = AppStateManager.instance; stateManager.OnAppStateChange.AddListener(ChangeState); }