/// <summary> /// Will select clicked building and ret true if one was seelected /// </summary> /// <returns></returns> bool SelectClickedBuild() { if (!Input.GetMouseButtonUp(0)) { return(false); } List <string> names = new List <string>(); var clicked = ReturnBuildinHit(); //unselect if was click outise if (clicked != null) { names = UString.ExtractNamesUntilGranpa(clicked); Program.InputMain.InputMouse.UnSelectRoutine(names, clicked); } //select new Build if (names.Count > 0) { for (int i = 0; i < names.Count; i++) { H typeL = Program.InputMain.InputMouse.FindType(names[i]); Ca cat = DefineCategory(typeL); Program.InputMain.InputMouse.Select(cat, names[i]); ManagerReport.AddInput("Selected building: " + names[i]); if (BuildingPot.Control.Registro.SelectBuilding != null) { return(true); } } } return(false); }
/// <summary> /// Creates a file of the type. Is a .txt with extension .sm /// /// </summary> /// <param name="type"></param> public static void CreateFile(string type, string text) { if (string.IsNullOrEmpty(text)) { return; } ManagerReport.AddNewText(type, text); var nameFile = SteamFriends.GetPersonaName() + "." + SteamUser.GetSteamID() + "_" + DateTime.Now.ToString("yy.MM.dd") + "_" + DateTime.Now.ToString("HH.mm.ss") + "_" + type + ".zip"; var path = Application.dataPath + "/" + nameFile; Debug.Log(path); File.WriteAllText(path, FileHeader() + text); if (SteamUser.GetSteamID().m_SteamID == 76561198245800476 || SteamUser.GetSteamID().m_SteamID == 76561197970401438) { Debug.Log("CreatFile Stopped"); return; } LogUploader.UploadDirectToAWSCarlos(path); }
// Update is called once per frame private void Update() { //if (_showAInventory != null) //{ // _showAInventory.Update(); //} if (_showPathToSea != null) { _showPathToSea.Update(); } if (_miniHelper != null && Input.GetKeyUp(KeyCode.F1)) { ManagerReport.AddInput("KeyCode.F1"); Program.MouseListener.HelpWindow.Show(""); } if (Input.GetKeyUp(KeyCode.F9)) { if (isShownNow) { HideCanvas(); } else { ShowCanvas(); } isShownNow = !isShownNow; } }
static void Main(string[] args) { DAL.Interfaces.IRepository <DAL.Entities.ManagerReport> dd = new ManagerReportRepository(); var user1 = new ManagerReport(DateTime.Now, "Jon", "Vlad", "Petrov", "Tomatos", 12); var user2 = new ManagerReport(DateTime.Now, "Jonas", "Hood", "Aroon", "Chips", 7); // добавляем их в бд dd.Create(user1); dd.Create(user2); dd.SaveChanges(); //Console.WriteLine("Объекты успешно сохранены"); // получаем объекты из бд и выводим на консоль var reports = dd.GetAll(); Console.WriteLine("Список объектов:"); foreach (ManagerReport u in reports) { Console.WriteLine("{0},{1},{2},{3},{4},{5}", u.Id, u.ManagerLastName, u.ClienFirstName, u.ClientLastName, u.ProductName, u.ProductCost); } Console.Read(); }
// Use this for initialization public void Start() { //loads main menu MyScreen1.Start(); DataController.Start(); Application.targetFrameRate = 60; //ProfilerHere(); ClassContainer = General.Create(Root.classesContainer); BuildsContainer = General.Create(Root.classesContainer, name: "BuildsContainer"); PersonObjectContainer = General.Create(Root.classesContainer, name: "PersonObjectsContainer"); MeshBatchContainer = General.Create(Root.classesContainer, name: "MeshBatchContainer"); if (Application.loadedLevelName == "Lobby") { //Settings.PlayMusic(); } else { if (gameScene == null) { gameScene = (GameScene)General.Create(Root.gameScene, container: ClassContainer.transform); InputMain = (InputMain)General.Create(Root.inputMain, container: ClassContainer.transform); } } MouseListener.Start(); ManagerReport.Start(); AudioCollector.RedoGame(); }
private void CheckIfKeyWasPressed() { //didnt load so one need to be redone if (Program.IsInputLocked || list == null) { return; } foreach (var item in list) { if (Input.GetKeyUp(item.saveKeyC)) { ManagerReport.AddInput("SaveCamPos:" + item.saveKeyC); SaveCamPos(item.saveKeyC, TransformCam.position, TransformCam.rotation); } } foreach (var item in list) { if (Input.GetKeyUp(item.loadKeyC)) { ManagerReport.AddInput("LoadCamPos:" + item.saveKeyC); LoadCamPos(item.loadKeyC); } } }
private void GeneralSwitch() { var ctrlS = Input.GetKeyUp(KeyCode.F) && (Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl)); if (Input.GetKeyUp(KeyCode.Escape)) { ManagerReport.AddInput(KeyCode.Escape + ""); EscapeKey(); } else if (Input.GetMouseButtonUp(1)) { RightClickRoutine(); } else if (!Dialog.IsActive() && Developer.IsDev && Input.GetKeyUp(KeyCode.F11)) { Program.gameScene.controllerMain.MeshController.ForcedTerraScanning(); } else if (!Dialog.IsActive() && (Input.GetKeyUp(KeyCode.F) || ctrlS) && !Program.IsInputLocked) { ManagerReport.AddInput("QuickSaveNow()"); QuickSaveNow(); } }
public void ChangeGameSpeedBy(int val) { if (Program.gameScene.GameController1.IsGameOver) { return; } val = DefineChangedVal(val); Program.gameScene.GameSpeed = val; if (Program.gameScene.GameSpeed < 0) { Program.gameScene.GameSpeed = 0; } else if (Program.gameScene.GameSpeed > 10) { Program.gameScene.GameSpeed = 10; } if (Program.gameScene.GameSpeed == 2) { Program.gameScene.TutoStepCompleted("2XSpeed.Tuto"); } //needs to be call for Body.cs OnChangeSpeed(EventArgs.Empty); ManagerReport.AddInput("Speed changed by:" + val + ". CurrSpeed: " + Program.gameScene.GameSpeed); ManagerReport.AddNewSpeed(Program.gameScene.GameSpeed); }
public void SelectPerson(Person pers) { ManagerReport.AddInput("Selected person: " + pers.name); PersonSelect = pers; _personWindow.Show(PersonSelect); UnselectingBuild(); _buildingWindow.Hide(); }
public void LoadingScreenIsDone() { CamControl.CAMRTS.InputRts.CenterCam(true); Program.MouseListener.LoadMainGUI(); Program.MouseListener.ApplyChangeScreenResolution(); DestroyCurrentMenu(); ManagerReport.AddFPS(); }
public ManagerReport Add(ManagerReport managerReport) { try { _context.ManagerReports.Add(managerReport); _context.SaveChanges(); CheckUserReportAcceptability(managerReport.ReportId); return(managerReport); } catch (Exception e) { _logger.Log("Error in saving manager report", e); return(null); } }
public bool Update(ManagerReport managerReport) { try { _context.ManagerReports.Update(managerReport); _context.SaveChanges(); CheckUserReportAcceptability(managerReport.ReportId); return(true); } catch (Exception e) { _logger.Log("Error in updating manager report", e); return(false); } }
/// <summary> /// Switch between modes /// </summary> private void ModeSwitcher() { if (Input.GetKeyUp(KeyCode.B)) { ManagerReport.AddInput("Mode.Building"); BuildingPot.InputMode = Mode.Building; //_audioPlayer.PlaySoundOneTime(RootSound.hoverMenuSound); DestroyCurrentSpawnBuild(); } else if (Input.GetKeyUp(KeyCode.C)) { //BuildingPot.InputMode = Mode.Cutting; //_audioPlayer.PlaySoundOneTime(RootSound.hoverMenuSound); } //if (BuilderPot.InputMode != Mode.Placing) { Cursor.visible = true; } }
// Update is called once per frame void Update() { //if (_showAInventory != null) //{ // _showAInventory.Update(); //} if (_showPathToSea != null) { _showPathToSea.Update(); } if (_miniHelper != null && Input.GetKeyUp(KeyCode.F1)) { ManagerReport.AddInput("KeyCode.F1"); Program.MouseListener.HelpWindow.Show(""); } }
/// <summary> /// This is where the selection of a new building to be built happen /// </summary> void BuildingMode() { foreach (var item in _fInputKeys) { if (Input.GetKeyUp(item.Key)) { ManagerReport.AddInput("SelecNewBuild: " + item.Key); //selection of the type of Building is goonna be build selection = item.Value; //print(selection + "."); } } //if something was selected if (selection != H.None) { //will find what numbers is that selection in Book.MenuGroupsList int indexSelection = -1; if (indexSelection == -1) { for (int i = 0; i < Program.gameScene.Book.MenuGroupsList.Count; i++) { if (selection == Program.gameScene.Book.MenuGroupsList[i]) { indexSelection = i; } } } if (indexSelection != -1) { //then in that list whaterever key is pressed will be pass for buildNow() foreach (var item in _inputListDict[indexSelection]) { if (Input.GetKeyUp(item.Key)) { //print(indexSelection + ".indexSelection"); BuildNowNew(item.Value); //print(selection + "."+item.Value ); ManagerReport.AddInput("BuildNowNew: " + item.Value); } } } } }
private void Update() { MouseListener.Update(); MyScreen1.Update(); ManagerReport.Update(); //if (!_didLoad2 && Time.time > 4) //{ // _didLoad2 = true; // Load2(); //} //if (!_didLoad3 && Time.time > 6) //{ // _didLoad3 = true; // Load3(); //} }
public void Next(string step) { if (_showAgainTuto == null) { return; } if (_currentIndex == -1 || step != _steps[_currentIndex] || _showAgainTuto.activeSelf) { return; } HideAllHelpers(); HideArrow(); ManagerReport.AddInput("Tuto.Step.Achieved:" + _steps[_currentIndex]); _currentIndex++; if (_currentIndex >= _steps.Count) { _currentIndex = -1; Hide(); //temporal Dialog.OKDialog(H.TutoOver); if (!Program.WasTutoPassed) { Program.gameScene.GameController1.Dollars += 10000; AudioCollector.PlayOneShot("BoughtLand", 0); BulletinWindow.SubBulletinFinance1.FinanceLogger.AddToAcct("Quests Completion", 10000); } ManagerReport.AddInput("Tutorial.Done:"); Program.gameScene.QuestManager.QuestFinished("Tutorial"); Program.WasTutoPassed = true; PlayerPrefs.SetString("Tuto", "Done"); return; } //QuestManager.QuestFinished("Tutorial"); Show(); }
/// <summary> /// Will try to select a person. Person selection has more importantce than /// building selection and priority /// </summary> /// <returns>Will retrun true if a person was selected</returns> private bool SelectPerson() { Transform clicked = UPoly.RayCastLayer(Input.mousePosition, 11).transform; if (clicked != null) { ManagerReport.AddInput("Selected person: " + clicked.name); PersonSelect = clicked.GetComponent <Person>(); _personWindow.Show(PersonSelect); UnselectingBuild(); _buildingWindow.Hide(); return(true); } _personWindow.Hide(); return(false); }
public void AddReport(DateTime date, string name, string position, int time, string comment) { string note = $"{date.ToShortDateString()},{name},{time},{comment}"; switch (position) { case "руководитель": ManagerReport.Add(note); break; case "сотрудник": EmployeeReport.Add(note); break; case "фрилансер": FreelancerReport.Add(note); break; } }
public BatchManagerEntity(MatchReport match, int round, bool isHome) : this() { TotalRound = round; _isHome = isHome; _match = match; if (_isHome) { Score = match.HomeScore; TotalRound = round; _homeReport = match.HomeManager; _awayReport = match.AwayManager; } else { Score = match.AwayScore; _homeReport = match.AwayManager; _awayReport = match.HomeManager; } BuildData(); }
private void BuildSkillInfo(ManagerReport manager, List <StatisticsSkillEntity> list) { foreach (var managerSkill in manager.SkillResults) { list.Add(BuildSkillEntity(managerSkill, "经理技能", manager.ManagerName)); } foreach (var player in manager.Players) { foreach (var pskill in player.SkillResults) { list.Add(BuildSkillEntity(pskill, "球员技能", player.Name)); } foreach (var process in player.MoveResults) { if (process.StateData.ModelId > 0) { list.Add(BuildSkillEntity(process.StateData.ModelId, process.AsRound, player.Name)); } } } }
private void Load1() { Debug.Log("first load"); //loads main menu MyScreen1.Start(); DataController.Start(); Application.targetFrameRate = 60; //ProfilerHere(); ManagerReport.Start(); MouseListener.Start(); if (//Camera.main != null && _audioPlayer == null && !audioWas) { audioWas = true; //bz camera needs to be initiated already _audioPlayer = new AudioPlayer(); } //AudioCollector.RedoGame(); }
//Center cam command public void CenterCam(bool fakedPressKeyP = false) { if (Dialog.IsActive() || Program.IsInputLocked) { return; } var yes = Input.GetKeyUp(KeyCode.P) || fakedPressKeyP; if (yes && !_isFollowingPersonNow) { ManagerReport.AddInput("CenterCam to 1st Building"); LoadFirstCamPos(); Program.gameScene.TutoStepCompleted("BackToTown.Tuto"); if (TownLoader.IsTemplate) { return; } CenterCamTo(BuildingPot.Control.Registro.AllBuilding.ElementAt(0).Value.transform); } }
public Manager(ManagerInput input, IMatch match, Side side) { if (input == null) { throw new ApplicationException("Initializes a new manager by null TransferManagerEntity."); } if (input.Players.Count == 0) { throw new ApplicationException("The manager has no team members. Manager name:" + input.Name); } if (input.Players.Count != Defines.Match.MAX_PLAYER_COUNT) { throw new ApplicationException("The manager's team members count is not 11. Manager name:" + input.Name + ", Team member count:" + input.Players.Count); } this._input = input; this._match = match; this._side = side; this._status = new ManagerStatus(); this._report = new ManagerReport(input); this._playerHash = new Dictionary <Position, List <IPlayer> >(4); _playerHash.Add(Position.Goalkeeper, new List <IPlayer>(8)); _playerHash.Add(Position.Fullback, new List <IPlayer>(8)); _playerHash.Add(Position.Midfielder, new List <IPlayer>(8)); _playerHash.Add(Position.Forward, new List <IPlayer>(8)); int formId = input.FormId; var formCfg = FormationCache.GetFormation(formId); int clientId = (_side == Side.Home) ? 0 : Defines.Match.MAX_PLAYER_COUNT; #region ISkill this.boostCore = new BoostCore(match); this.buffCore = new BuffCore(match); this.specBuffCoe = new SpecBuffCore(); this.rootSkill = new Skill(_match, this, string.Empty); #endregion PlayerInput pInput = null; Player player = null; for (var i = 0; i < input.Players.Count; i++) { pInput = input.Players[i]; var pForm = formCfg[i]; pInput.Position = (byte)pForm.Position; player = new Player(pInput, this, (byte)(i + clientId), pForm.Default, pForm.HalfDefault); _players.Add(player); _playerHash[pForm.Position].Add(player); } this.SkillPlayerList = new List <SkillEngine.SkillBase.Xtern.ISkillPlayer>(_players.Count); this.SkillPlayerList.AddRange(_players); #region Buff int last = _match.RoundPerMinute * 90; int point = 0; int percent = 0; if (null != input.PropList) { foreach (var item in input.PropList) { if (null == item.BuffId) { continue; } point = (int)(item.Point * 100); percent = (int)(item.Percent * 10000); this.AddBuff(CreatePropBuff(last, point, percent, item.BuffId)); } } if (null != input.BoostList) { foreach (var item in input.BoostList) { if (null == item.BuffId) { continue; } point = (int)(item.Point * 100); percent = (int)(item.Percent * 10000); this.AddBoost(CreateBoostBuff(item.BoostType, last, point, percent, item.BuffId)); } } #endregion }
void Update() { MouseListener.Update(); MyScreen1.Update(); ManagerReport.Update(); }
public async Task <IActionResult> CreateManagerReport(ManagerReportViewModel model) { var manager = await _userManager.FindByNameAsync(User.Identity.Name); var managerReport = _managerReportData.GetManagerReportByUserReportId(model.UserReport.Id, manager.Id); ManagerReport savedManagerReport; if (ModelState.IsValid) { if (managerReport == null) //means that user creating a new manager report { managerReport = new ManagerReport { Date = DateTime.Now, Author = manager, Text = model.Text, IsUserReportAcceptable = model.IsAcceptable, IsCommentViewableByUser = model.IsViewableByUser, ReportId = model.UserReport.Id }; savedManagerReport = _managerReportData.Add(managerReport); if (savedManagerReport == null) { ModelState.AddModelError("", "مشکل در ثبت گزارش!"); return(View(model)); } //Change the report status to viewed var result = _reportData.SetViewed(model.UserReport.Id, manager.Id); if (!result) { ModelState.AddModelError("", "مشکل در ثبت گزارش!"); return(View(model)); } } else //means user updating manager report { savedManagerReport = managerReport; managerReport.Text = model.Text; managerReport.IsUserReportAcceptable = model.IsAcceptable; managerReport.IsCommentViewableByUser = model.IsViewableByUser; var result = _managerReportData.Update(managerReport); if (result == false) { ModelState.AddModelError("", "مشکل در بروزرسانی!"); return(View(model)); } //Change the report status to viewed var setViewedResult = _reportData.SetViewed(model.UserReport.Id, manager.Id); if (!setViewedResult) { ModelState.AddModelError("", "مشکل در ثبت گزارش!"); return(View(model)); } } //Notify user if manager report is viewable by user if (model.IsViewableByUser) { var message = new Message { Title = "گزارش مدیر :: " + model.UserReport.Title, Text = model.Text, Sender = manager, Type = MessageType.Manager_Review_Notification, Time = DateTime.Now, }; _messageService.AddManagerReviewMessage(message, savedManagerReport.Id, model.UserReport.Author.Id); } else { _messageService.DeleteManagerReviewMessage(savedManagerReport.Id); } return(RedirectToAction("ManageReports", "Manager")); } return(View(model)); }
/// <summary> /// Depending on the current InputMode will direct the code to BuildingMode(); or /// Structure.Place, DrawWay(), DragFarm( /// </summary> public void BuildingSwitch(H val = H.None) { //Building mode if (InputMode == Mode.Building) { //with keyboard if (val == H.None) { BuildingMode(); } //with GUI buttons else { BuildNowNew(val); } } //Placing mode else if (InputMode == Mode.Placing) { //Vector3 iniPos = m.HitMouseOnTerrain.point; //var onMap = CamControl.CAMRTS.MiniMapRts.IsOnMapConstraints(iniPos); //if (!onMap) //{ // return; //} //Screen.showCursor = false; //Structures if (Control.CurrentSpawnBuild.Category == Ca.Structure || Control.CurrentSpawnBuild.Category == Ca.Shore) { Structure str = Control.CurrentSpawnBuild as Structure; //for bulldozer if (str != null) { str.UpdateClosestVertexAndOld(); } } //Ways and Farm if (Control.CurrentSpawnBuild.Category == Ca.Way || Control.CurrentSpawnBuild.Category == Ca.DraggableSquare) { UpdateWayFarmCursor(); if (Control.CurrentSpawnBuild.Category == Ca.Way) { DrawWay(); } else if (DefineCategory(DoingNow) == Ca.DraggableSquare) { DragFarm(); } } //Structures if (Input.GetKeyUp(KeyCode.R) && (DefineCategory(DoingNow) == Ca.Structure || (DefineCategory(DoingNow) == Ca.Shore))) { ManagerReport.AddInput("RotateBuilding"); Control.CurrentSpawnBuild.RotationAction(); AudioCollector.PlayOneShot("ClickMetal1", 0); } else if (Input.GetMouseButtonUp(0) && !_isDraggingWay && (DefineCategory(DoingNow) == Ca.Structure || (DefineCategory(DoingNow) == Ca.Shore))) { MouseUp(); } } }
public static void MouseClickListenerSt(string type) { _mouseListener.DetectMouseClick(type); ManagerReport.AddInput(type); }
private void OnApplicationQuit() { ManagerReport.FinishAllReports(); Settings.SaveToFile(); }