コード例 #1
0
        public WebProjectSelectionNode(Core.VplControl hostCanvas)
            : base(hostCanvas)
        {
            DataContext = this;

            AddOutputPortToNode("Project", typeof(object));
            // Call the Singleton Class to get the actual loaded elements -> Connection to the DataModel
            _controller = DataController.Instance;

            IsResizeable = true;

            var webControl = new WebProjectSelection(_controller.IntBase);
            {
                Visibility = Visibility.Visible;
            };

            // webControl.ProjectChangedEventHandler += ProjectSelectionViewModelOnProjectChangedEventHandler;
            // webControl.TeamChangedEventHandler += ProjectSelectionViewModelOnTeamChangedEventHandler;

            var pr = new ContentPresenter
            {
                Content = webControl,
                MinWidth = 600,
                MinHeight = 600
            };

            AddControlToNode(pr);
        }
コード例 #2
0
        public ElementTypeNode(Core.VplControl hostCanvas)
            : base(hostCanvas)
        {
            DataContext = this;

            // Call the Singleton Class to get the actual loaded elements -> Connection to the DataModel
            _controller = DataController.Instance;


            AddOutputPortToNode("ElementType", typeof (object));

            _typeComboBox = new ComboBox
            {
                DisplayMemberPath = "Name",
                Margin = new Thickness(5, 20, 5, 15)
            };
            _typeComboBox.SelectionChanged += SelectionChanged;

            if (_controller.IntBase.APICore != null)
            {
                _typeComboBox.ItemsSource = _controller.IntBase.APICore.GetElementTypes();
            }
            AddControlToNode(_typeComboBox);

            QuestButton.Visibility = Visibility.Visible;
            BinButton.Visibility = Visibility.Visible;

            // TopComment.Visibility = Visibility.Visible;
            // BottomComment.Visibility = Visibility.Visible;
        }
コード例 #3
0
ファイル: RayController.cs プロジェクト: dorxy/ive-latency
    // Use this for initialization
    void Start()
    {
        data = (DataController) FindObjectOfType (typeof(DataController));

        this.width = 0.1f;
        this.distance = 100.0f;
        this.heightOffset = 0.5f;
        this.inRayThreshold = 60;
        this.inRayNumberOfFrames = 0;
        this.distanceThreshold = 20;

        // Init the ray
        Vector3 pos = this.camera.transform.position;
        Vector3 dir = this.camera.transform.forward * distance + pos;
        Vector3 offsetH = this.camera.transform.up.normalized * heightOffset;
        pos += offsetH;
        dir += offsetH;

        var offset = dir - pos;
        var scale = new Vector3 (this.width, offset.magnitude / 2.0f, this.width);

        this.ray = (GameObject) Instantiate (this.cubePrefabObject, pos, Quaternion.identity);
        this.ray.transform.up = offset;
        this.ray.transform.localScale = scale;
        this.ray.GetComponent<Renderer> ().enabled = true;
    }
コード例 #4
0
 public void TechTreeLoad()
 {
     data = GameObject.Find("/TechTreeCanvas/Display").GetComponent<DataController>();
     if (!init)
     {
         foreach (string s in data.normalTree.GetNames())
         {
             normalUpgrades[s] = false;
         }
         foreach (string s in data.flyingTree.GetNames())
         {
             flyingUpgrades[s] = false;
         }
         foreach (string s in data.diggingTree.GetNames())
         {
             diggingUpgrades[s] = false;
         }
         init = true;
         data.InitializeMenu(normalFruit, diggingFruit, flyingFruit);
     }
     else
     {
         data.UpdateMenu(normalUpgrades, flyingUpgrades, diggingUpgrades, normalFruit, flyingFruit, diggingFruit);
     }
 }
コード例 #5
0
        public ProjectNode(Core.VplControl hostCanvas)
            : base(hostCanvas)
        {
            DataContext = this;

            // Call the Singleton Class to get the actual loaded elements -> Connection to the DataModel
            _controller = DataController.Instance;

            if (_controller.IntBase != null)
            {
                _projectComboBox = new ComboBox
                {
                    ItemsSource = _controller.IntBase.APICore.GetProjects(_controller.IntBase.APICore.CurrentTeam.Slug),
                    Width = 100,
                    SelectedItem = _selectedProject,
                    DisplayMemberPath = "Name",
                    Margin = new Thickness(5, 20, 5, 15)
                };

                // Add EventHandler
                _projectComboBox.SelectionChanged += SelectionChanged;

                if (_controller.IntBase != null)
                    AddControlToNode(_projectComboBox);
                else
                    AddControlToNode(new TextBox {Text = "No Connection"});
            }

            AddOutputPortToNode("Project", typeof (object));
        }
コード例 #6
0
        public PropertyNode(Core.VplControl hostCanvas): base(hostCanvas)
        { 
            DataContext = this;

            // Call the Singleton Class to get the actual loaded elements -> Connection to the DataModel
            _controller = DataController.Instance;

            // Ports 
            AddInputPortToNode("Element", typeof(object));
            AddOutputPortToNode("Property", typeof(object));

            // Init the Control 
            _control = new PropertyNodeControl
            {
                DataContext = this
            };

            AddControlToNode(_control);
            // EventHandlers 
            _control.ElementTypeListBox.SelectionChanged += ElementTypeListBoxOnSelectionChanged;
            _control.AttributeGroupListBox.SelectionChanged += AttributeGroupListBoxOnSelectionChanged;
            _control.AttributesListBox.SelectionChanged += AttributesListBoxOnSelectionChanged;

            _control.FilterTextBox.SelectionChanged += FilterTextBoxOnSelectionChanged;
        }
コード例 #7
0
    public void Start()
    {
        OnLanguageChanged();
        demomodeIndicator = skin.GetStyle("demomode");

        controller = (DataController)GameObject.Find("ThinkGear").GetComponent(typeof(DataController));
    }
コード例 #8
0
	//  Use this for initialization
	void Start () {
		instance = this;
		PackageInputObj = GameObject.Find("package").gameObject;
		VersionInputObj = GameObject.Find("VersionInputField").gameObject;
		BluethObj = GameObject.Find("lanya").gameObject;
		JiashujiObj = GameObject.Find("jiashuji").gameObject;
		TuoluoyiObj = GameObject.Find("tuoluoyi").gameObject;
		YaoganObj = GameObject.Find("YaoganToggle").gameObject;
		FXPObj = GameObject.Find("FXPToggle").gameObject;
		AToggle = GameObject.Find("AToggle").gameObject;
		BToggle = GameObject.Find("BToggle").gameObject;
		CToggle = GameObject.Find("CToggle").gameObject;
		DToggle = GameObject.Find("DToggle").gameObject;
		EToggle = GameObject.Find("EToggle").gameObject;
		FToggle = GameObject.Find("FToggle").gameObject;
		GToggle = GameObject.Find("GToggle").gameObject;
		HToggle = GameObject.Find("HToggle").gameObject;

		IToggle = GameObject.Find("IToggle").gameObject;
		JToggle = GameObject.Find("JToggle").gameObject;
		KToggle = GameObject.Find("KToggle").gameObject;
		LToggle = GameObject.Find("LToggle").gameObject;
		MToggle = GameObject.Find("MToggle").gameObject;
		NToggle = GameObject.Find("NToggle").gameObject;
		OToggle = GameObject.Find("OToggle").gameObject;
		PToggle = GameObject.Find("PToggle").gameObject;
		titleObj = GameObject.Find("titleText").gameObject;

		DetailObj = GameObject.Find("DetailPanel").gameObject;
		DetailObj.SetActive(false);
	}
コード例 #9
0
    public Service()
    {
        d = new DataController();
        //g = new graphStuff();
        db = new DataClassesDataContext();
        //get data from foodwastes table. Send this to the value field in graphdata

    }
コード例 #10
0
        public GetGeometryFromGenericElementNode(Core.VplControl hostCanvas): base(hostCanvas)
        {
            AddInputPortToNode("InputElements", typeof (List<GenericElement>));
            AddOutputPortToNode("ConvertedElements", typeof(List<DbGeometry>));

            _controller = DataController.Instance;

            DataContext = this;
        }
コード例 #11
0
        public override void Calculate()
        {
            _controller = DataController.Instance;

            if (_controller.IntBase != null)
            {
                OutputPorts[0].Data = _controller.IntBase;
            }
        }
コード例 #12
0
ファイル: BaseServiceTests.cs プロジェクト: emactaggart/CS476
 public BaseServiceTests()
 {
     _onlineMatchList = new List<MatchState>();
     _onlinePlayerList = new List<PlayerProfile>();
     _dataController = new DataController();
     _gameController = new GameController(_dataController, _onlineMatchList);
     _infoController = new InformationController(_dataController, _onlinePlayerList);
     _service = new BaseService(_gameController, _infoController);
 }
コード例 #13
0
        public IssueContainerNode(Core.VplControl hostCanvas)
            : base(hostCanvas)
        {
            // Call the Singleton Class to get the actual loaded elements -> Connection to the DataModel
            _controller = DataController.Instance;

            AddInputPortToNode("Project", typeof(object));
            AddOutputPortToNode("Issues", typeof(object));
            DataContext = this;
        }
コード例 #14
0
    void Start()
    {
        GameObject dataControllerObject = GameObject.FindGameObjectWithTag("DataController");
        dataController = dataControllerObject.GetComponent<DataController> ();

        options = new GUILayoutOption[] {
            GUILayout.Width(200),
            GUILayout.Height(50)
        };

        style.fontSize = 20;
        style.alignment = TextAnchor.MiddleLeft;
        style.normal.textColor = Color.white;
    }
コード例 #15
0
    void Start()
    {
        GameObject gameControllerObject = GameObject.FindGameObjectWithTag("GameController");
        arsenal = gameControllerObject.GetComponent<Arsenal>();
        uiController = gameControllerObject.GetComponent<UIController>();
        GameObject dataControllerObject = GameObject.FindGameObjectWithTag("DataController");
        dataController = dataControllerObject.GetComponent<DataController> ();

        playerController = GetComponent<PlayerController>();

        fireRate = arsenal.GetFireRate (fireType);
        fireBombRate = arsenal.GetFireRate (Constants.BOMB);

        numberOfSpawn = shotSpawnLeft.Length - 1;
    }
コード例 #16
0
        public GeometryOperationNode(Core.VplControl hostCanvas)
            : base(hostCanvas)
        {
            DataContext = this;

            // Call the Singleton Class to get the actual loaded elements -> Connection to the DataModel
            _controller = DataController.Instance;

            // Input
            AddInputPortToNode("InputElements_1", typeof(List<GenericElement>));
            // Input
            AddInputPortToNode("InputElements_2", typeof(List<GenericElement>));

            // Output
            AddOutputPortToNode("ResultElements", typeof(object));
        }
コード例 #17
0
        public StructureFilterNode(Core.VplControl hostCanvas)
            : base(hostCanvas)
        {
            // Call the Singleton Class to get the actual loaded elements -> Connection to the DataModel
            _controller = DataController.Instance;

            _control = new StructureFilterNodeControl();

            AddControlToNode(_control);

            AddInputPortToNode("Input", typeof (object));

            AddOutputPortToNode("FilteredElements", typeof(object));

            DataContext = this;
        }
コード例 #18
0
        public ElementMergeNode(Core.VplControl hostCanvas)
            : base(hostCanvas)
        {
            // Call the Singleton Class to get the actual loaded elements -> Connection to the DataModel
            _controller = DataController.Instance;

            var lbl = new Label{Content = "Filter Node ", Margin = new Thickness(5,15, 5, 10)};
            AddInputPortToNode("Input", typeof (object));
            AddInputPortToNode("Input", typeof(object));

            AddOutputPortToNode("MergedElements", typeof(object));

            // LabelCaption.Visibility = Visibility.Visible;
            // LabelCaption.Content = "";
            DataContext = this;
        }
コード例 #19
0
        public ElementContainerNode(Core.VplControl hostCanvas)
            : base(hostCanvas)
        {
            // Call the Singleton Class to get the actual loaded elements -> Connection to the DataModel
            _controller = DataController.Instance;

            _control = new ElementContainerNodeControl();
            _control.cancelBut.Click += CancelButOnClick;

            AddControlToNode(_control);

            AddInputPortToNode("Input", typeof (object));
            AddOutputPortToNode("Elements", typeof (object));

            DataContext = this;
        }
コード例 #20
0
ファイル: LoadNewGameManager.cs プロジェクト: 70-lab/Theo
        public void Start()
        {
            // Load data file
            _ec = ErrorController.Instance;
            _dc = DataController.Instance;

            saveInfo = new SaveInfo();

            if (!_dc.LoadData<SaveInfo>(ref saveInfo))
            {
                _dc.AddData(saveInfo);
                _dc.SaveAll();
            }

            // Check window elements

            if (ActionButtons.Length != SaveInfo.SavesCount)
            {
                _ec.PushError("Bad number of load buttons.", this, ErrorType.Error, true);
                return;
            }

            // Disable control buttons

            StartButton.GetComponent<Button>().interactable = false;

            DeleteButton.GetComponent<Button>().interactable = false;
            DeleteButton.GetComponentInChildren<Text>().text = _deleteButtonText;
            DeleteButton.GetComponent<Button>().onClick.AddListener(() => DeleteGame());

            // Set actions to buttons

            for (int i = 0; i < ActionButtons.Length; i++)
            {
                Button button = ActionButtons[i].GetComponent<Button>();
                int index = i;

                if (button == null)
                {
                    _ec.PushError("Bad element in action buttons list.", this, ErrorType.Error, true);
                    return;
                }

                button.onClick.AddListener(() => ActionButtonClick(index));
                button.GetComponentInChildren<Text>().text = saveInfo.Info[i].IsNewGame ? "Start new game" : saveInfo.Info[i].Name;
            }
        }
コード例 #21
0
ファイル: Duel.aspx.cs プロジェクト: hikaryuu/mb
    /**
     * Deduct one from battle counter.
     */
    protected void btnDuel_Click(object sender, EventArgs e)
    {
        DataController controller = new DataController();
        int succ = controller.useBattleCounter(user.userId.Value);

        if (succ == 1)
        {
            Session["Results"] = calculateBattle();
            Response.Redirect("~/DuelResult.aspx");
        }
        else
        {
            Session.Remove("Opponent");
            Session["ErrorMessage"] = "You have used up all your battle counters today.";
            Response.Redirect("~/Default.aspx");
        }
    }
コード例 #22
0
        // private List<BaseElement> _elements;

        public IssueNode(Core.VplControl hostCanvas)
            : base(hostCanvas)
        {
            _issueControl = new IssueNodeControl();
            _issueControl.BaseButtonClicked += IssueControlOnBaseButtonClicked;

            // Call the Singleton Class to get the actual loaded elements -> Connection to the DataModel
            _controller = DataController.Instance;

            AddInputPortToNode("Project/Model", typeof (object));
            AddInputPortToNode("LinkedElements", typeof (object));
            AddInputPortToNode("GeometryView", typeof (object));

            // Is this correct? There can be different members in different projects ...
            // _controller.IntBase.APICore.GetTea
            _issueControl.ResponsibleUserComboBox.ItemsSource = _controller.IntBase.APICore.GetTeamMembers();
            _issueControl.ResponsibleUserComboBox.DisplayMemberPath = "User";

            AddControlToNode(_issueControl);
            DataContext = this;
        }
コード例 #23
0
        public OperatorTestNode(Core.VplControl hostCanvas) : base(hostCanvas)
        {
            // Call the Singleton Class to get the actual loaded elements -> Connection to the DataModel
            _controller = DataController.Instance;

            AddInputPortToNode("Project", typeof (object));
            AddOutputPortToNode("Issues", typeof (object));
            DataContext = this;

            var content = new Label
            {
                Height = 200,
                Width = 200,
                Content = "Hallo"
            };

            AddControlToNode(content);

            // Border.CornerRadius = new CornerRadius(content.Height);
            // Border.Width = content.Width;
        }
コード例 #24
0
        public ElementFilterNode(Core.VplControl hostCanvas)
            : base(hostCanvas)
        {
            // Call the Singleton Class to get the actual loaded elements -> Connection to the DataModel
            _controller = DataController.Instance;

            // Add ComboBox to the control ... 
            _filterListBox = new ListBox()
            {
                MaxHeight = 200,
                MinWidth = 100,
                SelectionMode = SelectionMode.Multiple
            };

            _filterListBox.SelectionChanged += FilterListBoxOnSelectionChanged;
            AddControlToNode(_filterListBox);

            AddInputPortToNode("Input", typeof (object));
            AddOutputPortToNode("FilteredElements", typeof(object));

            DataContext = this;
        }
コード例 #25
0
        public AttachmentNode(Core.VplControl hostCanvas)
            : base(hostCanvas)
        {
            DataContext = this;

            // Call the Singleton Class to get the actual loaded elements -> Connection to the DataModel
            _controller = DataController.Instance;

            AddInputPortToNode("Project", typeof(object));
            AddOutputPortToNode("Attachment", typeof(object));

            _modelComboBox = new ComboBox
            {
                DisplayMemberPath = "FileName",
                Width = 100,
                Margin = new Thickness(5,20,5,15)
            };
            _modelComboBox.SelectionChanged += SelectionChanged;

            AddControlToNode(_modelComboBox);

            BinButton.Visibility = Visibility.Visible;
        }
コード例 #26
0
        private int getSelectedGroupId()
        {
            string groupName = textBoxGroupName.Text;

            return(DataController.GetGroups().getGroupID(groupName));
        }
コード例 #27
0
 private int getSelectedCourseId(string courseName)
 {
     return(DataController.GetCourses().getCourseID(courseName));
 }
コード例 #28
0
 static public DataTable fetchTienChiNguyenLieu(string id)
 {
     return(DataController.ExecTable("select matttc, tentttc, soluong, tennguyenlieu, thanhtien from tttienchi, nguyenlieu where tttienchi.manguyenlieu = nguyenlieu.manguyenlieu and tttienchi.maphieuchi = " + id));
 }
コード例 #29
0
 public DataControllerTests()
 {
     _controller = new DataController();
     _firstPlayer = Guid.Parse("12514A18-9A18-443A-9805-79BC51D38B6F");
     _secondPlayer = Guid.Parse("8701DD3B-00BB-4517-9BAB-453965DB1E81");
 }
コード例 #30
0
        /// <summary>
        /// Shows a list of items that can be selected; special for Members
        /// </summary>
        /// <param name="topMessage"></param>
        /// <param name="listDisplay"></param>
        /// <returns></returns>
        string SelectMember(string topMessage, ListDisplayMode listDisplay = ListDisplayMode.Compact)
        {
            var members = DataController.RetrieveByQuery(d => d.GetType() == typeof(MemberData)).ToList <object>();

            return(ListSelection <MemberData>(topMessage, members, listDisplay).ID);
        }
コード例 #31
0
        /// <summary>
        /// Shows a context-sensitive menu for listing, viewing, creating, editing, or deleting members
        /// </summary>
        /// <param name="dataMode"></param>
        /// <param name="displayMode"></param>
        /// <param name="selectedID"></param>
        void ShowMemberMenu(DataMode dataMode, ListDisplayMode displayMode = ListDisplayMode.Compact, string selectedID = null)
        {
            Console.Clear();

            string     selected     = selectedID;
            MemberData selectedData = null;

            if (dataMode != DataMode.Create)
            {
                if (selected == null)
                {
                    selected = SelectMember($"Please select the member whose details you wish to {(dataMode == DataMode.View ? "view" : "edit")}:\n", displayMode);
                }

                selectedData = (MemberData)DataController.RetrieveByID(selected);
            }

            switch (dataMode)
            {
            case DataMode.Create:
            case DataMode.Edit:
            {
                Dictionary <string, object> arguments = new Dictionary <string, object>();

                Console.WriteLine("Please fill out the following fields");
                Console.Write("Name: ");
                arguments.Add("name", Console.ReadLine());

                Console.Write("Personal Number: ");
                var pn = ReadValidInput((s) => {
                        var res = s.Length != 10 || s.Sum(c => { return(("0123456789".Contains(c)) ? 0 : c); }) > 0;
                        if (res)
                        {
                            Console.WriteLine("The personal number has to be all digits and ten digits long!");
                        }
                        return(res);
                    });
                arguments.Add("personal-num", pn);

                if (dataMode == DataMode.Create)
                {
                    DataController.CreateData(typeof(MemberData), arguments);
                }
                else
                {
                    DataController.ChangeData(selected, arguments);
                }
                break;
            }

            case DataMode.View:
            {
                Console.Clear();
                Console.Write(
                    $"Member ID: {selectedData.ID}\n" +
                    $"Time of creation: {selectedData.Timestamp}\n\n" +
                    $"Name: {selectedData.Name}\n" +
                    $"Personal Number: {selectedData.PersonalNumber}\n" +
                    $"Boats: ({selectedData.Boats.Count})\n");
                foreach (BoatData boat in selectedData.Boats)
                {
                    Console.WriteLine($" - {boat.Length}m {boat.BoatType} (Boat ID: {boat.ID})");
                }

                Console.WriteLine("\nPress E to edit this - Press D to delete this - Any else to return to main menu...");

                var key = Console.ReadKey().Key;

                switch (key)
                {
                case ConsoleKey.E: ShowMemberMenu(DataMode.Edit, selectedID: selected); break;

                case ConsoleKey.D: ShowDeleteConfirmation(selected); break;

                default: return;
                }

                break;
            }
            }
        }
コード例 #32
0
 public DataControllerTest()
 {
     _controller = new DataController();
 }
コード例 #33
0
        /// <summary>
        /// Shows a context-sensitive menu for listing, viewing, creating, editing, or deleting boats
        /// </summary>
        /// <param name="dataMode"></param>
        /// <param name="selectedID"></param>
        void ShowBoatMenu(DataMode dataMode, string selectedID = null)
        {
            Console.Clear();

            string   selected     = selectedID;
            BoatData selectedData = null;

            if (dataMode != DataMode.Create)
            {
                if (selected == null)
                {
                    selected = SelectBoat($"Please select the boat whose details you wish to {(dataMode == DataMode.View?"view":"edit")}:\n");
                }

                selectedData = (BoatData)DataController.RetrieveByID(selected);
            }

            switch (dataMode)
            {
            case DataMode.Create:
            case DataMode.Edit:
            {
                Dictionary <string, object> arguments = new Dictionary <string, object>();

                var owner = SelectMember("Please select the owner to register the new boat on\n");
                arguments.Add("owner", owner);

                Console.Write("Specify length of vessel in metre (m):");
                arguments.Add("length", int.Parse(Console.ReadLine()));

                var boatType = Enum.Parse(typeof(BoatType), ListSelection <string>("Please specify type of vessel", Enum.GetNames(typeof(BoatType)).ToList <object>()));
                arguments.Add("boat-type", boatType);

                if (dataMode == DataMode.Create)
                {
                    DataController.CreateData(typeof(BoatData), arguments);
                }
                else
                {
                    DataController.ChangeData(selected, arguments);
                }
                break;
            }

            case DataMode.View:
            {
                Console.Clear();
                Console.Write(
                    $"Boat ID: {selectedData.ID}\n" +
                    $"Time of creation: {selectedData.Timestamp}\n\n" +
                    $"Length: {selectedData.Length} metre\n" +
                    $"Type: {selectedData.BoatType}\n" +
                    (selectedData.Owner == null ? $"Owner: Owner not found\n" :
                     $"Owner: {selectedData.Owner.Name} (M-ID: {selectedData.Owner.ID})\n"));

                Console.WriteLine("\nPress E to edit this - Press D to delete this - Any else to return to main menu...");

                var key = Console.ReadKey().Key;

                switch (key)
                {
                case ConsoleKey.E: ShowBoatMenu(DataMode.Edit, selected); break;

                case ConsoleKey.D: ShowDeleteConfirmation(selected); break;

                default: return;
                }

                break;
            }
            }
        }
コード例 #34
0
ファイル: HomeController.cs プロジェクト: bencetaylor/Onlab
 public HomeController()
 {
     data = new DataController();
 }
コード例 #35
0
 public void SaveScore()
 {
     DataController.AddScore(points);
     points = 0;
 }
コード例 #36
0
ファイル: GameController.cs プロジェクト: duongkienhuy89/ALTP
 public void doSave()
 {
     DataController.SaveHightScore(level - 1);
     DataController.SaveHightSecond(dTime);
 }
コード例 #37
0
 public ProjectWorkflow(AppOptions options) : base(options)
 {
     DataController.InitializeAllProjects();
 }
コード例 #38
0
 public List <string> GetIndustryRoles()
 {
     return(DataController.GetIndustryRoles());
 }
コード例 #39
0
 private int getSelectedSkillId(string skillName)
 {
     return(DataController.GetSkills().getSkillID(skillName));
 }
コード例 #40
0
 private int getSelectedGroupId(string groupName)
 {
     return(DataController.GetGroups().getGroupID(groupName));
 }
コード例 #41
0
ファイル: StarChart.cs プロジェクト: MeisterOfPizza/Galaxies
        public void Use()
        {
            Inventory.RemoveItem(this);

            GalaxyController.AddVisitable(new PlanetarySystem(DataController.LoadData <PlanetarySystemData>(data.PlanetarySystemId, DataFileType.PlanetarySystems)));
        }
コード例 #42
0
 void Start()
 {
     dataController = FindObjectOfType <DataController>();
 }
コード例 #43
0
    private void HandlePartyPrefabs(DataController data, DataFormat dataFormat)
    {
        List <UIParty> formatParties = dataFormat.PartyInfoFormat(data, playerParties, characters);

        AddParties(formatParties);
    }
コード例 #44
0
 private void Start()
 {
     dataC = new DataController();
 }
コード例 #45
0
 public SimpleUserInterface()
 {
     DataController = new DataController();
 }
コード例 #46
0
	// Use this for initialization
	void Start () {
		dataController = this;
	}
コード例 #47
0
        /// <summary>
        /// Shows a list of items that can be selected; special for Boats
        /// </summary>>
        /// <param name="topMessage"></param>
        /// <param name="listDisplay"></param>
        /// <returns></returns>
        string SelectBoat(string topMessage, ListDisplayMode listDisplay = ListDisplayMode.Compact)
        {
            var boats = DataController.RetrieveByQuery(d => d.GetType() == typeof(BoatData)).ToList <object>();

            return(ListSelection <BoatData>(topMessage, boats, listDisplay).ID);
        }
コード例 #48
0
    public void AddItemCount(int shopCode)
    {
        switch (shopCode)
        {
        case 0:
            salty++;
            SubGold(DataController.GetInstance().GetPrice(DataController.GetInstance().GetShopCode()));
            PlayerPrefs.SetInt("Salty", salty);
            break;

        case 1:
            goso++;
            SubGold(DataController.GetInstance().GetPrice(DataController.GetInstance().GetShopCode()));
            PlayerPrefs.SetInt("Goso", goso);
            break;

        case 2:
            spicy++;
            SubGold(DataController.GetInstance().GetPrice(DataController.GetInstance().GetShopCode()));
            PlayerPrefs.SetInt("Spicy", spicy);
            break;

        case 3:
            sinmat++;
            SubGold(DataController.GetInstance().GetPrice(DataController.GetInstance().GetShopCode()));
            break;

        case 4:
            sseunmat++;
            SubGold(DataController.GetInstance().GetPrice(DataController.GetInstance().GetShopCode()));
            PlayerPrefs.SetInt("Sseunmat", sseunmat);
            break;

        case 5:
            sweet++;
            SubGold(DataController.GetInstance().GetPrice(DataController.GetInstance().GetShopCode()));
            PlayerPrefs.SetInt("Sweet", sweet);
            break;

        case 6:
            tennis++;
            SubGold(DataController.GetInstance().GetPrice(DataController.GetInstance().GetShopCode()));
            PlayerPrefs.SetInt("Tennis", tennis);
            break;

        case 7:
            wonban++;
            SubGold(DataController.GetInstance().GetPrice(DataController.GetInstance().GetShopCode()));
            PlayerPrefs.SetInt("Wonban", wonban);
            break;

        case 8:
            doll++;
            SubGold(DataController.GetInstance().GetPrice(DataController.GetInstance().GetShopCode()));
            PlayerPrefs.SetInt("Doll", doll);
            break;

        case 9:
            evo_1++;
            SubGold(DataController.GetInstance().GetPrice(DataController.GetInstance().GetShopCode()));
            PlayerPrefs.SetInt("Evo_1", evo_1);
            break;

        case 10:
            SubGold(DataController.GetInstance().GetPrice(DataController.GetInstance().GetShopCode()));

            break;
        }
    }
        public void DataSourcesControllerConstructorTest()
        {
            DataController target = new DataController();

            Assert.IsNotNull(target);
        }
コード例 #50
0
 void Awake()
 {
     dataController = FindObjectOfType <DataController>();
     _audio         = GetComponent <AudioSource>();
     _audio.volume  = PlayerPrefs.GetFloat(DataController.MUSIC_VOLUME);
 }
コード例 #51
0
    /// <summary>
    /// Ensure that this Controller is the only one we have
    /// </summary>
    /// <remarks>
    /// 
    /// <para>
    /// If we don't have an instance yet, then ensure that 
    /// the Game Object that this is attached to will not
    /// be destroyed between loads, and set the instance 
    /// of this object to itself.
    /// </para>
    /// <para>
    /// If we DO have an instance of this object, then destroy
    /// the new object we're attempting to create, in favor
    /// of the original one already in use.
    /// </para>
    /// </remarks>
    void Awake()
    {
        if (DataAccess == null)
        {

            DontDestroyOnLoad(gameObject);
            DataAccess = this;

            //Set up the global random number generator
            rnd = new System.Random();

            //Note2Dev: Might need to check this to ensure we aren't always loading...
            LoadMasterData();

            NewGame();

            int i = 0;

        }
        else if (DataAccess != null)
        {
            Destroy(gameObject);
        }
    }
コード例 #52
0
 public UpdateCommand(DataController dc)
 {
     this.dc = dc;
 }
コード例 #53
0
 public void Initialize()
 {
     _dataRepository = new Mock <IDataRepository>();
     _controller     = new DataController(_dataRepository.Object);
 }
コード例 #54
0
 public void VolverAlMenu()
 {
     dc = FindObjectOfType <DataController>();
     Destroy(dc.gameObject);
     SceneManager.LoadScene(0);
 }
コード例 #55
0
        private void ruajButton_Click(object sender, EventArgs e)
        {
            ArrayList produktFurnizim      = new ArrayList();
            ArrayList produktFurnizimToAdd = new ArrayList();

            DataController dc = new DataController();

            foreach (DataGridViewRow row in furnizimDataGrid.Rows)
            {
                try
                {
                    DataModel produkt = new DataModel();

                    produkt.ID    = Convert.ToInt32(row.Cells["ID"].Value);
                    produkt.Emri  = row.Cells["EmerProdukt"].Value.ToString();
                    produkt.Sasia = Convert.ToInt32(row.Cells["SasiProdukt"].Value);
                    produkt.Cmimi = Convert.ToDecimal(row.Cells["CmimProdukt"].Value);
                    produkt.Total = Convert.ToDecimal(row.Cells["TotalProdukt"].Value);

                    if (produkt.ID > 0)
                    {
                        produktFurnizim.Add(produkt);
                    }
                    else
                    {
                        produktFurnizimToAdd.Add(produkt);
                    }
                }
                catch
                {
                    //nuk ka me rreshta ne datagrid
                }

                furnizim.fatura = faturaBox.Text;

                //string selectedFurnitorName = FurnitorComboBox.SelectedItem.ToString();

                string selectedFurnitorName = this.FurnitorComboBox.GetItemText(this.FurnitorComboBox.SelectedItem);

                furnizim.furnitorID = dc.getFurnitorID(selectedFurnitorName);

                if (dc.editFurnizim(furnizim))
                {
                    if (dc.editProduktFurnizim(produktFurnizim))
                    {
                        if (produktFurnizimToAdd.Count > 0)
                        {
                            if (dc.shtoProdukteFurnizim(furnizim.ID, produktFurnizimToAdd))
                            {
                                if (MessageBox.Show("Furnizimi u modifikua") == DialogResult.OK)
                                {
                                    this.Close();
                                    Furnizim furnizimForm = new Furnizim();
                                    furnizimForm.Show();
                                }
                            }
                        }
                    }
                }
                else
                {
                    MessageBox.Show("Furnizimi nuk u modifikua!");
                }
            }
        }
コード例 #56
0
        private int getSelectedCourseId()
        {
            string courseName = textBoxCourseName.Text;

            return(DataController.GetCourses().getCourseID(courseName));
        }
コード例 #57
0
 protected void Start()
 {
     IsAlive = true;
     dataController = GetComponent<DataController>();
 }
コード例 #58
0
ファイル: ReadUser.cs プロジェクト: rajeshree3014/SCMDemo
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="data">DataController object</param>
 public ReadUser(DataController data)
     : base(data)
 {
 }
コード例 #59
0
 void Start()
 {
     GameObject dataController = GameObject.Find("DataController");
     if (dataController != null)
     {
         dc = dataController.GetComponent<DataController>();
     }
     else
     {
         throw new System.Exception("DataController was not found. Is it present and named 'DataController'?");
     }
 }
コード例 #60
0
 public void SwapSlotSetting(int i, int j, Button[] buttons, Text[] textsofButtons, DataController data)
 {
     buildings[i].occupancy[j].onClick.AddListener(() => SelectBuildingSlot(i, j, buttons, textsofButtons));
 }