Ejemplo n.º 1
0
        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>();
    }
Ejemplo n.º 4
0
        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(); });
    }
Ejemplo n.º 6
0
        protected override void Draw(GameTime GameTime)
        {
            AppStateManager.UpdatePreRender(GameTime);
            GraphicsDevice.Clear(Color.CornflowerBlue);
            RenderManager.Update(GameTime);

            base.Draw(GameTime);
        }
Ejemplo n.º 7
0
    void Awake()
    {
        appStateManager      = FindObjectOfType <AppStateManager>();
        generalConfiguration = FindObjectOfType <GeneralConfiguration>();
        spatialAnchorManager = FindObjectOfType <SpatialAnchorManager>();

        SetupCloudSessionAsync();
    }
Ejemplo n.º 8
0
        public Manager()
        {
            Configure(out _mailConfiguration);

            _appStateManager = new AppStateManager();
            _downloader      = new WebpageDownloader();
            _changesChecker  = new ChangesChecker(_downloader, _mailConfiguration);
        }
Ejemplo n.º 9
0
 public App()
 {
     Microsoft.ApplicationInsights.WindowsAppInitializer.InitializeAsync(
         Microsoft.ApplicationInsights.WindowsCollectors.Metadata |
         Microsoft.ApplicationInsights.WindowsCollectors.Session);
     this.InitializeComponent();
     AppStateManager appStateManager = new AppStateManager(this);
 }
Ejemplo n.º 10
0
        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));
        }
Ejemplo n.º 11
0
 //Singleton design pattern
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
Ejemplo n.º 12
0
 private void TryLoad()
 {
     try
     {
         AppStateManager.Initialize(mainWindow);
     }
     catch (Exception e)
     {
         MessageBoxFactory.ShowError(e, "Loading Error");
     }
 }
Ejemplo n.º 13
0
	// Use this for initialization
	void Awake () {
        if (theOne == null)
        {
            theOne = this;
        }
        else
        {
            DestroyImmediate(this);
        }
        changeStateId(currentStateId);
	}
Ejemplo n.º 14
0
        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)));
        }
Ejemplo n.º 15
0
 // Use this for initialization
 void Awake()
 {
     currentStateId = stateComponents[0].id;
     Debug.Log(currentStateId);
     if (theOne == null)
     {
         theOne = this;
     }
     else
     {
         DestroyImmediate(this);
     }
     changeState(currentStateId);
 }
Ejemplo n.º 16
0
        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;
        }
Ejemplo n.º 17
0
        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);
        }
Ejemplo n.º 18
0
        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"));
        }
Ejemplo n.º 19
0
        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>();
        }
Ejemplo n.º 20
0
        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);
        }
Ejemplo n.º 21
0
        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();
        }
Ejemplo n.º 22
0
    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];
    }
Ejemplo n.º 23
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);
        }
Ejemplo n.º 24
0
        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"));
        }
Ejemplo n.º 25
0
 void Start()
 {
     appStateManager = AppStateManager.stateManager;
 }
Ejemplo n.º 26
0
 void Start()
 {
     appStateManager      = FindObjectOfType <AppStateManager>();
     generalConfiguration = FindObjectOfType <GeneralConfiguration>();
 }
Ejemplo n.º 27
0
        protected override void Update(GameTime gameTime)
        {
            AppStateManager.Update(gameTime);

            base.Update(gameTime);
        }
Ejemplo n.º 28
0
    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
        }
    }
Ejemplo n.º 29
0
 private void BindManager(AppStateManager stateManager)
 {
     _stateManager = stateManager;
 }
Ejemplo n.º 30
0
        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();
 }
Ejemplo n.º 32
0
 // Use this for initialization
 void Start()
 {
     FindAllTools();
     stateManager = AppStateManager.instance;
     stateManager.OnAppStateChange.AddListener(ChangeState);
 }