// Use this for initialization void Start() { EnemyCurrentHealth = EnemyMaxHealth; enemySprite = GetComponent <SpriteRenderer>(); kill = FindObjectOfType <Killer>(); sound = FindObjectOfType <EffectsManager>(); }
static void Main(string[] args) { ConsoleReader consoleReader = new ConsoleReader(); int victimHealh = consoleReader.GetHealth(); Victim victim = consoleReader.GetVictim(victimHealh); victim.StepsToRun = 10; Killer killer = consoleReader.GetKiller(); Weapon weapon = consoleReader.ChooseWeapon(killer); Shield shield = consoleReader.ChooseShield(victim); for (int i = 0; i < victim.StepsToRun; i++) { killer.Voice(); victim.Voice(); victim.Health = victim.Armor(shield, victim.Health); victim.Health = killer.Attack(weapon, victim.Health); if (victim.Health <= 0) { Console.WriteLine("Victim died"); break; } } }
// Use this for initialization void Start() { sound = FindObjectOfType <EffectsManager>(); thePlayer = FindObjectOfType <PlayerController>(); kill = FindObjectOfType <Killer>(); Items = FindObjectOfType <Item>(); }
public JournalDied(JObject evt) : base(evt, JournalTypeEnum.Died) { string killerName = evt["KillerName"].Str(); if (string.IsNullOrEmpty(killerName)) { if (evt["Killers"] != null) { Killers = evt["Killers"].ToObjectProtected <Killer[]>(); } } else { // it was an individual Killers = new Killer[1] { new Killer { Name = killerName, Name_Localised = evt["KillerName_Localised"].Str(), Ship = evt["KillerShip"].Str(), Rank = evt["KillerRank"].Str() } }; } if (Killers != null) { foreach (Killer k in Killers) { k.Ship = JournalFieldNaming.GetBetterShipName(k.Ship); k.Name_Localised = JournalFieldNaming.CheckLocalisation(k.Name_Localised ?? "", k.Name); } } }
public override int GetHashCode() { unchecked { var hashCode = Assistants?.GetHashCode() ?? 0; hashCode = (hashCode * 397) ^ (int)DeathDisposition; hashCode = (hashCode * 397) ^ IsAssassination.GetHashCode(); hashCode = (hashCode * 397) ^ IsGroundPound.GetHashCode(); hashCode = (hashCode * 397) ^ IsHeadshot.GetHashCode(); hashCode = (hashCode * 397) ^ IsMelee.GetHashCode(); hashCode = (hashCode * 397) ^ IsShoulderBash.GetHashCode(); hashCode = (hashCode * 397) ^ IsWeapon.GetHashCode(); hashCode = (hashCode * 397) ^ (Killer?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ KillerAgent.GetHashCode(); hashCode = (hashCode * 397) ^ (KillerWeaponAttachmentIds?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ (int)KillerWeaponStockId; hashCode = (hashCode * 397) ^ (KillerWorldLocation?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ (Victim?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ VictimAgent.GetHashCode(); hashCode = (hashCode * 397) ^ (VictimAttachmentIds?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ (int)VictimStockId; hashCode = (hashCode * 397) ^ (VictimWorldLocation?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ (int)EventName; hashCode = (hashCode * 397) ^ (TimeSinceStart?.GetHashCode() ?? 0); return(hashCode); } }
public IActionResult Register(Killer FromForm) { if (ModelState.IsValid) { // This is checking for uniqueness based on alias if (dbContext.Killers.Any(k => k.Alias == FromForm.Alias)) { ModelState.AddModelError("Alias", "A killer with that alias already exists!"); return(RegisterForm()); } // Creating an instance of the imported pw hashing object PasswordHasher <Killer> Hasher = new PasswordHasher <Killer>(); // And now, use that hasher to actually encrypt the password attached to the // killer submitted via the registration form FromForm.Password = Hasher.HashPassword(FromForm, FromForm.Password); // Now that we have encrypted the password, let's go ahead and push it into the database dbContext.Killers.Add(FromForm); dbContext.SaveChanges(); // Now that we've created the new killer, let's put their Id in session // so we've "logged them in" HttpContext.Session.SetInt32("KillerId", FromForm.KillerId); return(RedirectToAction("Dashboard")); } else { return(RegisterForm()); } }
public void SimplePinTest() { using (var session = Domain.OpenSession()) using (session.OpenTransaction()) { var butcher = new Killer(); var firstVictim = new Victim(); // "Killers" who have not killed yet should not be considered as killers using (session.DisableSaveChanges(butcher)) { session.SaveChanges(); Assert.AreEqual(PersistenceState.New, butcher.PersistenceState); Assert.AreEqual(PersistenceState.Synchronized, firstVictim.PersistenceState); butcher.Kill(firstVictim); session.SaveChanges(); Assert.AreEqual(PersistenceState.New, butcher.PersistenceState); Assert.AreEqual(PersistenceState.Modified, firstVictim.PersistenceState); } session.SaveChanges(); using (session.DisableSaveChanges(butcher)) { firstVictim.Resurrect(); var secondVictim = new Victim(); butcher.Kill(secondVictim); session.SaveChanges(); Assert.AreEqual(PersistenceState.Modified, butcher.PersistenceState); Assert.AreEqual(PersistenceState.Synchronized, firstVictim.PersistenceState); Assert.AreEqual(PersistenceState.Synchronized, secondVictim.PersistenceState); } } }
private void btnRepeat_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txtPath.Text)) { OriginPath = txtPath.Text.Trim(); tvRepeats.Nodes.Clear(); Killer kill = new Killer(OriginPath); var rptList = kill.GetFiles(SubDir); Cursor = Cursors.WaitCursor; if (InceptionMode) { KillList = new List <FileInfo>(); KillList.AddRange(kill.EvaluateFileInfoListDuplicated(rptList)); } Cursor = Cursors.Default; if (KillList.Count > 0) { LoadTreeViewData(KillList, tvRepeats, 1); } else { MessageBox.Show($"No hay archivos repetidos en ningunta ruta"); } } }
public void Die(Killer killer) { _currentState.Die(killer); if (!_audioSource.isPlaying) { _audioSource.Play(); } }
public State <T> Step() { State = Killer.Kill(State); State = CrossOver.CrossOver(State); //State = Mutator.Mutate(State); return(State); }
// Use this for initialization void Start () { enemy = FindObjectOfType<EnemyHealthManager>(); killer = FindObjectOfType<Killer>(); room = FindObjectOfType<Target>(); anim = room.GetComponent<Animator>(); sound = FindObjectOfType<EffectsManager>(); StartCoroutine(Sound()); }
public void DeregisteKiller(Killer killer) { if (this.killers.ContainsKey(killer.GetID())) { this.killers.Remove(killer.GetID()); } return; }
public void CheckRaise() { if (Killer != null && Spells.Third.BlessSpell.occido.Contains(Killer)) { Spells.Necromancy.AnimateDeadSpell.ExternalTarget(this, Killer); Killer.SendMessage("raising dead"); } }
private void TriggerAttack(int instanceID, Killer killer) { if (this.killers.ContainsKey(instanceID)) { killer.Attack(this.victims); this.tm.doOnce <int, Killer>(killer.GetFireInterval(), this.TriggerAttack, instanceID, killer); } return; }
// Use this for initialization void Start() { sound = FindObjectOfType <EffectsManager>(); thePlayerSpeed = FindObjectOfType <PlayerController>(); thePlayerHealth = FindObjectOfType <PlayerHealthManager>(); thePlayerDamage = FindObjectOfType <PlayerShoot>(); kill = FindObjectOfType <Killer>(); Items = FindObjectOfType <Item>(); }
public JournalDied(JObject evt) : base(evt, JournalTypeEnum.Died) { string killerName = evt["KillerName"].Str(); if (string.IsNullOrEmpty(killerName)) // no killer name { if (evt["Killers"] != null) // by a wing { Killers = evt["Killers"].ToObjectQ <Killer[]>(); } else { string killerShip = evt["KillerShip"].Str(); // by an automated device if (killerShip.HasChars()) { ItemData.Actor a = ItemData.GetActor(killerShip); Killers = new Killer[1] { new Killer { Name = killerShip, Name_Localised = a != null ? a.Name : killerShip.SplitCapsWordFull(), Ship = "", Rank = "", } }; } } } else { // it was an individual Killers = new Killer[1] { new Killer { Name = killerName, Name_Localised = evt["KillerName_Localised"].Str(), Ship = evt["KillerShip"].Str(), Rank = evt["KillerRank"].Str() } }; } if (Killers != null) { foreach (Killer k in Killers) { if (ItemData.IsShip(k.Ship)) { k.Ship = JournalFieldNaming.GetBetterShipName(k.Ship); } k.Name_Localised = JournalFieldNaming.CheckLocalisation(k.Name_Localised ?? "", k.Name); } } }
public void RegisteKiller(Killer killer) { print("Register: killer" + killer.GetID().ToString()); if (!this.killers.ContainsKey(killer.GetID())) { this.killers.Add(killer.GetID(), killer); this.tm.doOnce <int, Killer>(killer.GetFireInterval(), this.TriggerAttack, killer.GetID(), killer); } return; }
private BankPlugin GetSelection() { if ((this.listView1.SelectedItems == null) || (this.listView1.SelectedItems.Count == 0)) { return(null); } List <BankPlugin> plugins = Killer.GetPlugins(); return(plugins.Find(p => p.Bank == this.listView1.SelectedItems[0].Text)); }
static void Main(string[] args) { // Logger log = new TextFileLogger("text.log"); //Logger log = new ConsoleLogger(); //Logger log = new DebugOutputLogger(); //Logger log = new TracerLogger(); //Trace.Listeners.Add(new TextWriterTraceListener("logger.log")); //Trace.Listeners.Add(new XmlWriterTraceListener("logger.xml")); CombineLogger combine_log = new CombineLogger(); combine_log.Add(new ConsoleLogger()); combine_log.Add(new DebugOutputLogger()); combine_log.Add(new TracerLogger()); combine_log.Add(new TextFileLogger("new_text.log")); ILogger log = combine_log; combine_log.LogInformation("Message1"); combine_log.LogInformation("Info Message"); combine_log.LogInformation("Error Message"); Student student = new Student { Name = "Иванов" }; ComputerLongDataValue(30, student); Console.WriteLine("Операция завершена"); combine_log.Flush(); /////////////////////////////////////////////////////////////// All_kicks_main war = new Killer(); war.Magic_kick(); ////////////////////////////////////////////////////// Robot robot = new Robot(100, 100); //////////////////////////////////////////// MyClass my = new MyClass(10); foreach (var a in my) { Console.WriteLine("{0,4}", a); } Console.ReadLine(); }
// Start is called before the first frame update private void Awake() { killer = GetComponent <Killer>(); rb2d = GetComponent <Rigidbody2D>(); collider = GetComponent <Collider2D>(); castMask = LayerMask.GetMask("Solid", "Player"); idleState = new State(IdleStateUpdate); dropState = new State(DropStateUpdate, DropStateEnter); sm.Transition(idleState); }
/* * ---------------------------------------------------------------------------------------------------------------- * GENERAL * ---------------------------------------------------------------------------------------------------------------- */ /* * rotation come as Vector2 from server * x : pitch : head rotation * y : yaw : body rotation * bodyRotation : Vector3 (0f, yaw * SensitivityYaw, 0f); * headRotation : Vector3 (pitch * SensitivityPitch, 0f, 0f); */ private void MoveKiller(string id, Vector3 position, Vector2 rotation) { Killer killer = FindKillerByID(id); //Debug.Log ("vector length diff:" + Mathf.Abs((killer.transform.position - position).magnitude)); killer.simulatedEndPos = position; killer.simulatedHeadEndLocalRot = Quaternion.Euler(new Vector3(rotation.x, 0f, 0f)); // head only pitch killer.simulatedBodyEndRot = Quaternion.Euler(new Vector3(0f, rotation.y, 0f)); // body only yaw }
private void DrawKiller() { foreach (Element k in field.place) { Killer kill = k as Killer; if (kill != null) { g.DrawImage(k.img, k.X, k.Y, k.Width, k.Height); } } }
private void OnKillerDie(SocketIOEvent evt) { string id = JsonToString(evt.data.GetField("id").ToString(), "\""); Killer killer = FindKillerByID(id); if (killer) { killer.Die(); } }
public AppDriver(string args, int timeoutMs) { _proc = Process.Start(ExePath, args); _app = new WindowsAppFriend(_proc); _mainWindowDriver = new MainWindowDriver(_app.Type <System.Windows.Application>().Current.MainWindow); WPFStandardControls_3.Injection(_app); WPFStandardControls_3_5.Injection(_app); WPFStandardControls_4.Injection(_app); WindowsAppExpander.LoadAssembly(_app, GetType().Assembly); _killer = new Killer(timeoutMs, _proc); }
static void Run() { var configPath = Path.Combine(AppUtils.AppDir(), "config.xml"); if (!File.Exists(configPath)) { throw new FileNotFoundException($"Не найден файл с настройками программы: '{configPath}'"); } var killer = new Killer(configPath); killer.Loop(); }
private void RefreshPlugins() { this.listView1.Items.Clear(); List <BankPlugin> plugins = Killer.GetPlugins(); foreach (BankPlugin plugin in plugins) { ListViewItem item = new ListViewItem(); item.Text = string.Format("{0}", plugin.Bank); item.SubItems.Add(Killer.IsPluginEnabled(plugin) ? "Yes" : "No"); this.listView1.Items.Add(item); } }
private void btnCharge_Click(object sender, EventArgs e) { ClearMe(); if (!string.IsNullOrEmpty(txtPath.Text)) { OriginPath = txtPath.Text.Trim(); Killer kill = new Killer(OriginPath); var listaResult = kill.GetFilesInfo(SubDir); LoadTreeViewData(listaResult, tvData); } }
public override void Paint(GridLayout grid, GameObject layer, Vector3Int position) { Tilemap tm = BrushUtility .GetLayer(layerName) .GetComponent <Tilemap>(); Killer killer = tm.gameObject.GetComponent <Killer>() ?? layer.AddComponent <Killer>(); killer.SetOnKilledEvent(onKilledEvent); killer.SetLayerMask(killerMask); tm.SetTile(position, tile); }
private void LoadSubNodes(List <FileInfo> sources, TreeNode treeNode, int mode) { if (sources.Count != 0) { var agregados = sources.Where(o => o.Directory.FullName.Equals(treeNode.Name)).ToList(); agregados.ForEach((item) => treeNode.Nodes.Add(item.Name)); if (mode.Equals(0)) { var repetidos = new Killer().EvaluateFileInfoListDuplicated(agregados.Select(x => x.FullName).ToList()).ToList(); KillList.AddRange(repetidos); } var listaClear = sources.Where(i => !agregados.Select(x => x.FullName).ToList().Contains(i.FullName)).OrderByDescending(x => x.FullName).ToList(); var lista = listaClear.GroupBy(u => u.DirectoryName.Replace(treeNode.Name, "").Split('\\')[1]).OrderBy(x => x.Key).ToList(); foreach (var file in lista) { var items = file.Select(x => x).ToList(); var vll = items.Where(o => o.Directory.Name.Equals(file.Key)).Select(i => i.DirectoryName).FirstOrDefault(); if (vll is null) { var temPath = treeNode.Name + '\\' + file.Key; var txtNode = file.Key; var nd = new TreeNode(txtNode); nd.Name = temPath; treeNode.Nodes.Add(nd); LoadSubNodes(items, nd, mode); } else { if (items.Count >= 1) { var temPath = vll; var txtNode = file.Key; var nd = new TreeNode(txtNode); nd.Name = temPath; treeNode.Nodes.Add(nd); LoadSubNodes(items, nd, mode); } } } } }
public void MainTest() { using (var session = Domain.OpenSession()) { using (var t = session.OpenTransaction()) { var k = new Killer("K"); k.Victims.Add(new Victim("V")); session.SaveChanges(); k.Remove(); // Rollback } } }
void hotkey_Pressed(object sender, EventArgs e) { Process[] processes = Process.GetProcesses(); if (processes != null && processes.Count() > 0) { foreach (Process item in processes) { if (item.ProcessName.ToLower().Contains("webdev.webserver")) { ThreadStart ts = new ThreadStart(item.Kill); Thread t = new Thread(ts); Killer k = new Killer(CheckState); k.BeginInvoke(ref t, CallBack, null); } } if (found < 1) { label1.Text = "Couldnt find process!"; } } }
public JournalDied(JObject evt ) : base(evt, JournalTypeEnum.Died) { string killerName = Tools.GetStringDef(evt["KillerName"]); if (string.IsNullOrEmpty(killerName)) { if (evt["Killers"]!=null) Killers = evt["Killers"].ToObject<Killer[]>(); } else { // it was an individual Killers = new Killer[1] { new Killer { Name = killerName, Ship = Tools.GetStringDef(evt["KillerShip"]), Rank = Tools.GetStringDef(evt["KillerRank"]) } }; } }
public static void RefreshInventory(GameObject k, Killer.PickUpData dat) { HUD hud = k.GetComponent<HUD>(); Killer killer = k.GetComponent<Killer>(); if(dat.Type == PickUp.PickUpType.Weapon) hud.InventoryWeapon.sprite = Resources.Load<Sprite>("Sprites/postitArmes/postit" + dat.Name); if (dat.Type == PickUp.PickUpType.Signature) hud.InventorySignature.sprite = Resources.Load<Sprite>("Sprites/postitObjets/postit" + dat.Name); if (dat.Equals(null)) hud.InventorySignature.sprite = null; }
public void killEnemyEvent(int enemyId, long heroGUID) { int heroIndex = -1; Killer killer; Killer k = new Killer(); for (int i = 0; i < skadas.Count; i++) { if (skadas[i].id == heroGUID) { heroIndex = i; for (int j = 0; j < skadas[i].killer.Count; j++) { killer = skadas[i].killer[j]; if (killer.id == enemyId) // has enemy { //操作完毕返回 killer.number++; return; } } //无此敌人 直接添加 k.id = enemyId; k.number = 1; skadas[i].killer.Add(k); return; } } Skada newData = new Skada(); newData.id = heroGUID; k.id = enemyId; k.number = 1; newData.killer.Add(k); skadas.Add(newData); }
void Awake(){ _killer = this.GetComponent<Killer> (); }