public Keeper() { instance = this; SKDataManager.LoadData(); CellManager.Recalculate(); AddChild(mainContainer = new FContainer()); SetupMegaBoxes(); mainContainer.AddChild(slotList = new SlotList(Config.LIST_WIDTH, Config.HEIGHT)); AddChild(effectContainer = new FContainer()); slotList.SignalPlayerChange += HandlePlayerChange; HandlePlayerChange(); Futile.screen.SignalResize += HandleSignalResize; Futile.instance.SignalLateUpdate += HandleLateUpdate; FSoundManager.PlaySound("UI/Start"); }
void Start () { obj_keeper = GameObject.FindGameObjectWithTag("GLOBAL_keeper"); keeper = obj_keeper.GetComponent<Keeper>(); obj_fade = GameObject.FindGameObjectWithTag("GLOBAL_fade"); fade = obj_fade.GetComponent<Fade>(); if (fade_on_start) { fade.EndFade(); } }
//Семантический разбор поля Inputs private void ParseInputs() { Inputs.Clear(); InputsList.Clear(); Vars.Clear(); var inputs = (ListNode <InputNode>) new InputsParsing(Keeper, InputsStr).ResultTree; TablikVar v = null; foreach (var node in inputs.Nodes) { var varCode = node.Token.Text; if (Inputs.ContainsKey(varCode)) { Keeper.AddError("Два входа с одинаковыми именами", node); } else if (varCode.ToLower() == "расчет" || varCode.ToLower() == "calc") { Keeper.AddError("Недопустимое имя входа", node); } switch (node.InputType) { case InputType.Simple: var dt = node.TypeNode == null ? DataType.Real : node.TypeNode.Text.ToDataType(); var at = node.SubTypeNode == null ? ArrayType.Single : node.SubTypeNode.Token.Text.ToArrayType(); var val = node.ValueNode == null ? null : node.ValueNode.Mean; v = new TablikVar(varCode, new SimpleType(dt, at), val); break; case InputType.Param: if (!Module.Params.ContainsKey(node.TypeNode.Text)) { Keeper.AddError("Не найден расчетный параметр", node.TypeNode); } else { var par = Module.Params[node.TypeNode.Text]; if (node.SubTypeNode == null) { if (!par.IsFun) { Keeper.AddError("Параметр без входов не может быть типом данных входа", node.TypeNode); } else { v = new TablikVar(varCode, par); } } else if (!par.Params.ContainsKey(node.SubTypeNode.Text)) { Keeper.AddError("Не найден расчетный подпараметр", node.SubTypeNode); } else { var spar = par.Params[node.SubTypeNode.Text]; if (!spar.IsFun) { Keeper.AddError("Подпараметр без входов не может быть типом данных входа", node.SubTypeNode); } else { v = new TablikVar(varCode, spar); } } } break; case InputType.Signal: string scode = node.TypeNode.Text.Substring(1, node.TypeNode.Text.Length - 2); ObjectTypeBase t = null; foreach (var con in Module.LinkedSources) { if (con.ObjectsTypes.ContainsKey(scode)) { if (t == null) { t = con.ObjectsTypes[scode]; } else { Keeper.AddError("Одинаковый код типа объекта в двух разных источниках", node); } } else if (con.BaseObjectsTypes.ContainsKey(scode)) { if (t == null) { t = con.BaseObjectsTypes[scode]; } else { Keeper.AddError("Одинаковый код типа объекта в двух разных источниках", node); } } } if (t != null) { v = new TablikVar(varCode, t) { MetSignals = new SetS(), MetProps = new SetS() } } ; else { Keeper.AddError("Не найден тип объекта или сигнала", node); } break; } if (v != null) { if (Inputs.ContainsKey(v.Code)) { Keeper.AddError("Два входа с одинаковыми именами", node); } else { if (v.DefaultValue == null && InputsList.Count > 0 && InputsList[InputsList.Count - 1].DefaultValue != null) { Keeper.AddError("Входы со значениямия по умолчанию должны располагаться в конце списка входов", node); } InputsList.Add(Vars.Add(v.Code, Inputs.Add(v.Code, v))); } } } }
void Update() { if (Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.RightControl)) { isDebugModeActive = !isDebugModeActive; debugCanvas.SetActive(isDebugModeActive); Debug.Log("Debug mode now active."); } if (isDebugModeActive) { // Help window if (Input.GetKeyDown(KeyCode.Alpha0)) { debugCanvas.SetActive(!debugCanvas.activeInHierarchy); } // Unlimited action points if (Input.GetKeyDown(KeyCode.Alpha6)) { if (GameManager.Instance.CurrentState == GameState.InBattle) { for (int i = 0; i < BattleHandler.CurrentBattleKeepers.Length; i++) { BattleHandler.CurrentBattleKeepers[i].GetComponent <Fighter>().PhysicalSymbolStored = 9; BattleHandler.CurrentBattleKeepers[i].GetComponent <Fighter>().DefensiveSymbolStored = 9; BattleHandler.CurrentBattleKeepers[i].GetComponent <Fighter>().MagicalSymbolStored = 9; } if (BattleHandler.isPrisonerOnTile) { GameManager.Instance.PrisonerInstance.GetComponent <Fighter>().PhysicalSymbolStored = 9; GameManager.Instance.PrisonerInstance.GetComponent <Fighter>().DefensiveSymbolStored = 9; GameManager.Instance.PrisonerInstance.GetComponent <Fighter>().MagicalSymbolStored = 9; } } else { if (isUnlimitedActionPointsModeActive) { Debug.Log("Deactivate unlimited action points mode."); foreach (PawnInstance pi in GameManager.Instance.AllKeepersList) { pi.GetComponent <Keeper>().MaxActionPoints = 3; pi.GetComponent <Keeper>().ActionPoints = 3; } } else { Debug.Log("Activate unlimited action points mode."); foreach (PawnInstance pi in GameManager.Instance.AllKeepersList) { pi.GetComponent <Keeper>().MaxActionPoints = 99; pi.GetComponent <Keeper>().ActionPoints = 99; } } isUnlimitedActionPointsModeActive = !isUnlimitedActionPointsModeActive; } } // Discover all tiles if (Input.GetKeyDown(KeyCode.Alpha9)) { if (Input.GetKey(KeyCode.LeftShift)) { if (isMapUncovered) { if (oldTileStates != null && oldTileStates.Count > 0) { foreach (Tile tile in oldTileStates.Keys) { tile.State = oldTileStates[tile]; } } } isMapUncovered = false; } else { if (!isMapUncovered) { oldTileStates.Clear(); foreach (Tile tile in TileManager.Instance.Tiles.GetComponentsInChildren <Tile>()) { oldTileStates.Add(tile, tile.State); tile.State = TileState.Discovered; } } isMapUncovered = true; } } // Decrease food Ashley if (Input.GetKey(KeyCode.CapsLock) && Input.GetKey(KeyCode.Alpha2)) { if (Input.GetKey(KeyCode.LeftShift)) { GameManager.Instance.PrisonerInstance.GetComponent <HungerHandler>().CurrentHunger++; } else { GameManager.Instance.PrisonerInstance.GetComponent <HungerHandler>().CurrentHunger--; } } if (GameManager.Instance.ListOfSelectedKeepers == null || GameManager.Instance.ListOfSelectedKeepers.Count == 0) { return; } // Kill selected character if (Input.GetKeyDown(KeyCode.Alpha1)) { Debug.Log("Killed " + GameManager.Instance.GetFirstSelectedKeeper().Data.PawnName + " using debug tools."); GameManager.Instance.GetFirstSelectedKeeper().GetComponent <Mortal>().CurrentHp = 0; } // Decrease food if (Input.GetKey(KeyCode.Alpha2) && !Input.GetKey(KeyCode.CapsLock)) { if (GameManager.Instance.CurrentState == GameState.InBattle) { if (Input.GetKey(KeyCode.LeftShift)) { GameManager.Instance.GetFirstSelectedKeeper().GetComponent <Fighter>().PhysicalSymbolStored++; } else { GameManager.Instance.GetFirstSelectedKeeper().GetComponent <Fighter>().PhysicalSymbolStored--; } } else { if (Input.GetKey(KeyCode.LeftShift)) { GameManager.Instance.GetFirstSelectedKeeper().GetComponent <HungerHandler>().CurrentHunger++; } else { GameManager.Instance.GetFirstSelectedKeeper().GetComponent <HungerHandler>().CurrentHunger--; } } } // Decrease mental health if (Input.GetKey(KeyCode.Alpha3)) { if (GameManager.Instance.CurrentState == GameState.InBattle) { if (Input.GetKey(KeyCode.LeftShift)) { GameManager.Instance.GetFirstSelectedKeeper().GetComponent <Fighter>().DefensiveSymbolStored++; } else { GameManager.Instance.GetFirstSelectedKeeper().GetComponent <Fighter>().DefensiveSymbolStored--; } } else { if (Input.GetKey(KeyCode.LeftShift)) { GameManager.Instance.GetFirstSelectedKeeper().GetComponent <MentalHealthHandler>().CurrentMentalHealth++; } else { GameManager.Instance.GetFirstSelectedKeeper().GetComponent <MentalHealthHandler>().CurrentMentalHealth--; } } } // Decrease HP if (Input.GetKey(KeyCode.Alpha4)) { if (Input.GetKey(KeyCode.LeftShift)) { GameManager.Instance.GetFirstSelectedKeeper().GetComponent <Mortal>().CurrentHp++; } else { GameManager.Instance.GetFirstSelectedKeeper().GetComponent <Mortal>().CurrentHp--; } } if (Input.GetKeyDown(KeyCode.Alpha5)) { if (GameManager.Instance.CurrentState == GameState.InBattle) { if (Input.GetKey(KeyCode.LeftShift)) { GameManager.Instance.GetFirstSelectedKeeper().GetComponent <Fighter>().MagicalSymbolStored++; } else { GameManager.Instance.GetFirstSelectedKeeper().GetComponent <Fighter>().MagicalSymbolStored--; } } else { if (Input.GetKey(KeyCode.LeftShift)) { GameManager.Instance.GetFirstSelectedKeeper().GetComponent <Keeper>().ActionPoints++; } else { GameManager.Instance.GetFirstSelectedKeeper().GetComponent <Keeper>().ActionPoints--; } } } // Pop a monster if (Input.GetKeyDown(KeyCode.Alpha7)) { if (GameManager.Instance.CurrentState == GameState.InBattle) { GameManager.Instance.GetBattleUI.GetComponent <UIBattleHandler>().EscapeBattle(); } else { Instantiate(monsterToPopPrefab, GameManager.Instance.GetFirstSelectedKeeper().CurrentTile.transform.position, Quaternion.identity, GameManager.Instance.GetFirstSelectedKeeper().CurrentTile.transform); } } // Pop an item on the ground if (Input.GetKeyDown(KeyCode.Alpha8)) { ItemContainer[] itemToSpawn = new ItemContainer[1]; itemToSpawn[0] = new ItemContainer(GameManager.Instance.ItemDataBase.ItemsList[Random.Range(0, GameManager.Instance.ItemDataBase.ItemsList.Count)], itemsToPopAmount); ItemManager.AddItemOnTheGround(GameManager.Instance.GetFirstSelectedKeeper().CurrentTile, GameManager.Instance.GetFirstSelectedKeeper().CurrentTile.transform, itemToSpawn); } // TP selected keeper if (Input.GetKey(KeyCode.T)) { if (Input.GetKeyDown(KeyCode.P)) { RaycastHit hitInfo; if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hitInfo) == true) { if (hitInfo.transform.GetComponentInParent <Tile>() != null) { Tile destinationTile = hitInfo.transform.GetComponentInParent <Tile>(); PawnInstance selectedKeeper = GameManager.Instance.GetFirstSelectedKeeper(); TileManager.Instance.RemoveKeeperFromTile(selectedKeeper.CurrentTile, selectedKeeper); TileManager.Instance.AddKeeperOnTile(destinationTile, selectedKeeper); // Physical movement selectedKeeper.GetComponent <AnimatedPawn>().StartBetweenTilesAnimation(destinationTile.transform.position); //selectedKeeper.transform.position = destinationTile.transform.position; GameObject currentCharacter; Keeper keeperComponent = selectedKeeper.GetComponent <Keeper>(); for (int i = 0; i < keeperComponent.GoListCharacterFollowing.Count; i++) { currentCharacter = keeperComponent.GoListCharacterFollowing[i]; if (currentCharacter.GetComponent <Escortable>() != null) { currentCharacter.GetComponent <PawnInstance>().CurrentTile = destinationTile; currentCharacter.GetComponent <AnimatedPawn>().StartBetweenTilesAnimation(destinationTile.transform.position + Vector3.right * 0.2f); } } } } } } if (Input.GetKeyDown(KeyCode.R)) { GameManager.Instance.ResetGameData(); GameManager.Instance.CurrentState = GameState.Normal; AudioManager.Instance.Fade(AudioManager.Instance.menuMusic); GameManager.Instance.Ui.GoActionPanelQ.transform.parent.SetParent(GameManager.Instance.Ui.transform); SceneManager.LoadScene(0); } } }
/// <summary> /// 添加一个仓库保管人员 /// </summary> /// <param name="keeper"></param> /// <returns></returns> public static bool AddKeeper(Keeper keeper) { string sqlStr = string.Format("insert into Keeper values('{0}') ", keeper.Name); return(new DBUtility.SQLHelper().ExecuteNonQuery(sqlStr) > 0); }
private static void KeeperCleanedAShit(Keeper keeper, turd.Turd turd) { }
public int Longin(Keeper k) { return(kd.Longin(k)); }
public bool AddKeeper(Keeper keeper) { return(KeeperDAO.AddKeeper(keeper)); }
public static void Init() { using (var Data = new DataKeeper()) { var neutral = new Keeper { Name = "Neutral" }; var k1 = new Keeper { Name = "Nightwings" }; Data.Keepers.AddRange(new List <Keeper> { neutral, k1 }); Data.SaveChanges(); var a1 = new Actor { Name = "Urado", ActorKeeper = k1 }; var a2 = new Actor { Name = "Nakiva", ActorKeeper = k1 }; var a3 = new Actor { Name = "Teltonia", ActorKeeper = k1 }; Data.Actors.AddRange(new List <Actor> { a1, a2, a3 }); k1.KeptActors.Add(a1); k1.KeptActors.Add(a2); k1.KeptActors.Add(a3); Data.SaveChanges(); var t1 = new Town { Name = "Novigrad", Position = new Point { X = 0, Y = 0 }, DetectingRadius = 100, CollisionRadius = 5, EnitityKeeper = k1 }; t1.Actors.Add(a1); var army1 = new MovingGroup { Name = "Wing of Hope", Position = new Point { X = 6, Y = 0 }, DetectingRadius = 50, CollisionRadius = 1, EnitityKeeper = k1, Move = 10 }; army1.Actors.Add(a2); army1.Actors.Add(a3); var m1 = new Mine { Name = "Give Me Money beach", Position = new Point { X = 10, Y = -30 }, DetectingRadius = 50, CollisionRadius = 2, EnitityKeeper = neutral, Effectivity = 2, MiningResourse = ResourseTypes.Gold }; Data.Enitities.AddRange(new List <BaseMapEnitity> { t1, army1, m1 }); k1.KeptEnitity.Add(t1); k1.KeptEnitity.Add(army1); k1.KeptEnitity.Add(m1); Data.SaveChanges(); } using (var Data = new DataKeeper()) { foreach (var a in Data.Keepers) { Console.WriteLine(a); } Console.WriteLine(); foreach (var a in Data.Actors) { Console.WriteLine(a); } Console.WriteLine(); foreach (var a in Data.Enitities) { //Console.WriteLine("{0} {1} {2} {3} {4}", a.GetType().ToString(), a.Name, a.EnitityKeeper.Name, a.Position.X, a.Position.Y); Console.WriteLine(a.ToString()); } } }
public void ReactiveFirstActivity(GameObject firstActivity) { for (int i = 0; i < activeKeepers; i++) { keepers[i].gameObject.SetActive(false); } Keeper[] newKeepers = new Keeper[keepers.Length - activeKeepers]; for (int i = 0; i < newKeepers.Length; i++) { newKeepers[i] = keepers[i + activeKeepers]; } keepers = newKeepers; for (int i = 0; i < activeKeepers; i++) { words[i].gameObject.SetActive(false); } Word[] newWords = new Word[words.Length - activeKeepers]; for (int i = 0; i < newWords.Length; i++) { newWords[i] = words[i + activeKeepers]; } words = newWords; activeKeepers = 5; for (int i = 0; i < activeKeepers; i++) { keepers[i].gameObject.SetActive(true); } for (int i = 0; i < activeKeepers; i++) { words[i].gameObject.SetActive(true); } continueBtn.SetActive(false); AnotherGame.SetActive(false); firstActivity.SetActive(true); Word.drag = true; pass = () => { string message = ""; for (int i = 0; i < activeKeepers; i++) { if (keepers[i].keeped != null) { message += keepers[i].keeped.GetComponent <Word>().Pword + ((i < activeKeepers - 1) ? " " : ""); } else { return; } } if (message == "puedes crear tu propio universo") { EndFirstActivity(); pass = () => { firstActivity.SetActive(false); ExitToFirstActivity(); }; } }; }
public MainWindow() { InitializeComponent(); Keeper.Load(); entitiesControl.Load(); typesControl.Load(); Log.Logger = new LoggerConfiguration() .MinimumLevel.Debug() .WriteTo.RollingFile("logs/log.txt", retainedFileCountLimit: 7, restrictedToMinimumLevel: Serilog.Events.LogEventLevel.Verbose) .WriteTo.Sink(new PopupEventSink(this), restrictedToMinimumLevel: Serilog.Events.LogEventLevel.Warning) .CreateLogger(); Log.Information("Started"); fromDatePicker.SelectedDate = DateTime.Now.AddMonths(-1); toDatePicker.SelectedDate = DateTime.Now; foreach (TabItem p in pagesTabControl.Items) { if (p.Content is IUpdatableControl) { (p.Content as IUpdatableControl).Changed += (x, y) => { writeDBButton.IsEnabled = true; }; } } #region Filter var selectAll = new MenuItem() { Header = "Select/Deselect all" }; TypeFilter.Items.Add(selectAll); selectAll.IsChecked = true; selectAll.StaysOpenOnClick = true; selectAll.Click += (x, y) => { bool sel = !selectAll.IsChecked; foreach (MenuItem t in TypeFilter.Items) { t.IsChecked = sel; } ApplyTypeFilter(); }; List <OperationType> types = new List <OperationType>(); types.AddRange(DAL.GetOperationTypes()); types.Add(OperationType.Empty); foreach (var t in types) { var tf = new TypeFilterMenuItem(t); tf.IsChecked = true; tf.StaysOpenOnClick = true; tf.Click += (x, y) => tf.IsChecked = !tf.IsChecked; tf.Click += (x, y) => ApplyTypeFilter(); TypeFilter.Items.Add(tf); } ApplyTypeFilter(); #endregion }