public void AddFilter(object args) { if (args.GetType() == typeof(Skill_Type)) { specifiedfilters.RemoveAll(a => a.GetType() == typeof(Skill_Type)); specifiedfilters.Add((Skill_Type)args); } else if (args.GetType() == typeof(int)) { specifiedfilters.RemoveAll(a => a.GetType() == typeof(int)); specifiedfilters.Add((int)args); } else if (args.GetType() == typeof(Damage)) { specifiedfilters.RemoveAll(a => a.GetType() == typeof(Damage)); specifiedfilters.Add((Damage)args); } else if (args.GetType() == typeof(Target)) { specifiedfilters.RemoveAll(a => a.GetType() == typeof(Target)); specifiedfilters.Add((Target)args); } else { return; } SkillCollection.OrganizeSkillList(specifiedfilters.ToArray()); comboBox1.DataSource = SkillCollection.GetNames; }
/// <summary> /// Default constructor. /// </summary> /// <param name="identity">The identity for this character</param> /// <param name="guid">The unique identifier.</param> /// <exception cref="System.ArgumentNullException">identity</exception> protected Character(CharacterIdentity identity, Guid guid) { identity.ThrowIfNull(nameof(identity)); CharacterID = identity.CharacterID; m_name = identity.CharacterName; Identity = identity; Guid = guid; Corporation = new Corporation(this); SkillGroups = new SkillGroupCollection(this); Skills = new SkillCollection(this); UpdateAccountStatus(); EmploymentHistory = new EmploymentRecordCollection(this); ImplantSets = new ImplantSetCollection(this); Plans = new PlanCollection(this); CertificateCategories = new CertificateCategoryCollection(this); CertificateClasses = new CertificateClassCollection(this); Certificates = new CertificateCollection(this); MasteryShips = new MasteryShipCollection(this); for (int i = 0; i < m_attributes.Length; i++) { m_attributes[i] = new CharacterAttribute(this, (EveAttribute)i); } UISettings = new CharacterUISettings(); }
/// <summary> /// Default constructor. /// </summary> /// <param name="identity">The identitiy for this character</param> /// <param name="guid">The unique identifier.</param> /// <exception cref="System.ArgumentNullException">identity</exception> protected Character(CharacterIdentity identity, Guid guid) { identity.ThrowIfNull(nameof(identity)); CharacterID = identity.CharacterID; m_name = identity.CharacterName; CorporationID = identity.CorporationID; CorporationName = identity.CorporationName; Identity = identity; Guid = guid; Corporation = new Corporation(this); SkillGroups = new SkillGroupCollection(this); Skills = new SkillCollection(this); EmploymentHistory = new EmploymentRecordCollection(this); ImplantSets = new ImplantSetCollection(this); Plans = new PlanCollection(this); CertificateCategories = new CertificateCategoryCollection(this); CertificateClasses = new CertificateClassCollection(this); Certificates = new CertificateCollection(this); MasteryShips = new MasteryShipCollection(this); for (int i = 0; i < m_attributes.Length; i++) { m_attributes[i] = new CharacterAttribute(this, (EveAttribute)i); } UISettings = new CharacterUISettings(); }
public Form1() { InitializeComponent(); saveToolStripMenuItem.Enabled = false; SkillCollection.SkillDeserializeJson(); comboBox1.DataSource = SkillCollection.GetNames; comboBox1.SelectedIndexChanged += comboBox1_SelectedIndexChanged; comboBox1.SelectedIndex = 0; comboBox1_SelectedIndexChanged(this, null); AddFilterButton.ParentForm = this; ComboFilter.ParentForm = this; ComboTypeFilter.ParentForm = this; NumericCostFilter.form1 = this; ComboDamageFilter.ParentForm = this; ComboTargetFilter.ParentForm = this; flowLayoutPanel1.Controls.Add(addfilterbutton); }
private void SearchSkill() { DAL dal = new DAL(); /*for (int i = SkillCollection.Count - 1; i >= 0; i--) * { * * SkillCollection.RemoveAt(i); * * }*/ SkillCollection.Clear(); DataTable dt = dal.Read("Select * from bit_skill WHERE (STATUS='ACTIVE' OR STATUS IS NULL) and " + SelectedSkillCols + " like '%" + SkillSearchString + "%'"); int i = 0; int index = 0; Skill skillFirstRecord = new Skill(); foreach (DataRow dr in dt.Rows) { index = i; if (index == 0) { skillFirstRecord = new Skill(dr); } Skill skill = new Skill(dr); SkillCollection.Add(skill); i++; } SelectedSkill = skillFirstRecord; //MessageBox.Show(SelectedSkillCols + SkillSearchString); }
private void PopulateSkillCollection() { var forgeDatabase = Global.Instance.ForgeDatabase(); var tempSkillCollection = new BindableCollection <SkillCollection>(); foreach (var skill in forgeDatabase.Skills) { tempSkillCollection.Add(new SkillCollection { ID = skill.ID, Name = skill.Name, Description = skill.Description }); } if (SkillCollection.SequenceEqual(Global.Instance.SkillCollection)) { SkillCollection = new BindableCollection <SkillCollection>(tempSkillCollection); } else { Global.Instance.SkillCollection = new BindableCollection <SkillCollection>(tempSkillCollection); SkillCollection = new BindableCollection <SkillCollection>(tempSkillCollection); } }
public void SkillCollection_can_construct_ctor3() { // AAA - Arrange, Act, Assert // Arrange var list = new List <Skill>() { new Skill { SkillID = 101, Name = "PW7" }, new Skill { SkillID = 102, Name = "Paws" }, new Skill { SkillID = 103, Name = "Pies" } }; // Act var sut = new SkillCollection(list); // Assert Assert.Multiple(() => { Assert.That(sut, Is.Not.Null); Assert.That(sut.Count, Is.EqualTo(3)); }); }
public void SkillCollection_AddRecord() { ISkillsDataSource database = new MockSkillsDataSource(); SkillCollection skillCollection = new SkillCollection(database, new MockLevelFormula(), new MockLevelFormula()); Dictionary <string, Skill> skills = database.GetAllSkills(); Skill a = skills["a"]; Skill abe = skills["abe"]; Skill e = skills["e"]; Skill c = skills["c"]; Skill cef = skills["cef"]; Skill f = skills["f"]; skillCollection.AddRecord(DateTime.Today, 15f, a); Record record = database.GetAllRecords().Select(x => x.Value).Where(y => y.originGuid == a.guid).First(); Assert.AreSame(record, a.records[0]); Assert.AreSame(record, abe.records[0]); Assert.AreEqual(15f, abe.records.Sum(x => x.amount)); Assert.AreEqual(0, e.records.Count); skillCollection.AddRecord(DateTime.Today, 22f, c); Record record2 = database.GetAllRecords().Select(x => x.Value).Where(y => y.originGuid == c.guid).First(); Assert.AreSame(record2, abe.records[1]); Assert.AreSame(record2, f.records[0]); Assert.AreEqual(1, cef.records.Count); }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { boxtype.Text = SkillCollection.GetSkillInfo((string)comboBox1.SelectedItem, "Type"); boxmp.Text = SkillCollection.GetSkillInfo((string)comboBox1.SelectedItem, "MP"); boxdamage.Text = SkillCollection.GetSkillInfo((string)comboBox1.SelectedItem, "Damage"); boxtargets.Text = SkillCollection.GetSkillInfo((string)comboBox1.SelectedItem, "Targets"); boxdesc.Text = SkillCollection.GetSkillInfo((string)comboBox1.SelectedItem, "Desc"); }
private void Start() { _shiftX = Random.Range(-minMaxShift, minMaxShift); _shiftZ = Random.Range(-minMaxShift, minMaxShift); _maxLifetime = _lifetime; SkillList = SkillCollection.Instance; }
public SkillsListViewModel(SkillCollection skillCollection, TimeInputManager timeInput, GameObject anchor) { this.anchor = anchor; this.timeInput = timeInput; viewModels = new List <SkillViewModel>(); recordViewModels = new List <RecordViewModel>(); this.skillCollection = skillCollection; skillCollection.OnSkillAdded += NewSkill; }
public void Setup(EntityAsset asset) { SkillCollection.SkillCollectionId = asset.SkillCollectionId; SkillCollection.SetupCollection(); GambitCollection.GambitCollectionId = asset.GambitCollectionId; GambitCollection.SetupCollection(); Perception.AlertMask = asset.AlertMask; Perception.Range = asset.Vision; Tag = asset.Tag; }
// Use this for initialization void Start() { atkTimer = 0.0f; atkDelay = -1.0f; curAMode = eAttackMode.NORMAL; anim = this.gameObject.GetComponent <Animator> (); targeter = this.gameObject.GetComponent <IsTargeter>(); dSCollection = this.gameObject.GetComponent <SkillCollection> (); dead = false; }
public void SkillCollection_can_construct_ctor0() { // AAA - Arrange, Act, Assert // Arrange var sut = new SkillCollection(); // Act // Assert Assert.That(sut, Is.Not.Null); }
} // 技能清单 /// <summary> /// 类型:方法 /// 名称:Character /// 作者:taixihuase /// 作用:通过用户信息构造一个角色对象 /// 编写日期:2015/7/22 /// </summary> /// <param name="user"></param> public Character(UserInfo user) : base(user) { Position = new Position(); Experience = new Experience(); Occupation = new Occupation(); Attribute = new CharacterAttribute(); Weapons = new WeaponCollection(); Armors = new ArmorCollection(); Jewels = new JewelCollection(); Skills = new SkillCollection(); }
public void Awake() { instance = this; Game.Scene.GetComponent <ResourcesComponent>().LoadBundle(abName); skillCollection = Game.Scene.GetComponent <ResourcesComponent>().GetAsset(abName, "SkillCollection") as SkillCollection; #if UNITY_EDITOR TestDeserialize(); #else activeDatas = skillCollection.activeSkillDataDic; #endif }
private void AddSkill() { //SelectedSkill.Insert(); Skill skill = new Skill(); SkillCollection.Add(skill); SelectedSkill = skill; MessageBox.Show("Click Save button after entering the new skill.", "Skill", MessageBoxButton.OK, MessageBoxImage.Warning); IsEnabledAdd = false; IsEnabledSave = true; IsEnabledDelete = false; }
public override async Task InitializeAsync(object navigationData) { var pop = await _dialogService.OpenLoadingPopup(); InitDataFilter = await _iDDLService.GetInitDataFilter(); JobTypeCollection = InitDataFilter.JobTypeDLL.Cast <object>().ToObservableCollection(); CategoryCollection = InitDataFilter.ClassificationDLL.Cast <object>().ToObservableCollection(); LocationCollection = InitDataFilter.LocationDDL.Cast <object>().ToObservableCollection(); PositionCollection = InitDataFilter.PositionDLL.Cast <object>().ToObservableCollection(); SkillCollection = InitDataFilter.SkillsDLL.Cast <object>().ToObservableCollection(); QualificationCollection = InitDataFilter.QualificationDLL.Cast <object>().ToObservableCollection(); LicenceCollection = InitDataFilter.TicketsDLL.Cast <object>().ToObservableCollection(); dynamic objSearchDifinition = await _candidateExploreService.GetSavedSearchDefinition(); if (objSearchDifinition["parameter"] != null) { string[] jobTypeIds = objSearchDifinition["parameter"]["JobTypeIds"].ToString().Split(','); JobTypeSelected = new ObservableCollection <object>(JobTypeCollection.Where(x => Array.IndexOf(jobTypeIds, (x as LookupItem).Id) >= 0)); string[] categoryIds = objSearchDifinition["parameter"]["CategoryIds"].ToString().Split(','); CategorySelected = new ObservableCollection <object>(CategoryCollection.Where(x => Array.IndexOf(categoryIds, (x as LookupItem).Id) >= 0)); string[] locationIds = objSearchDifinition["parameter"]["LocationIds"].ToString().Split(','); LocationSelected = new ObservableCollection <object>(LocationCollection.Where(x => Array.IndexOf(locationIds, (x as LookupItem).Id) >= 0)); string[] positionIds = objSearchDifinition["parameter"]["PositionIds"].ToString().Split(','); PositionSelected = new ObservableCollection <object>(PositionCollection.Where(x => Array.IndexOf(positionIds, (x as LookupItem).Id) >= 0)); string[] skillIds = objSearchDifinition["parameter"]["SkillsIds"].ToString().Split(','); SkillSelected = new ObservableCollection <object>(SkillCollection.Where(x => Array.IndexOf(skillIds, (x as LookupItem).Id) >= 0)); string[] qualificationIds = objSearchDifinition["parameter"]["QualificationsIds"].ToString().Split(','); QualificationSelected = new ObservableCollection <object>(QualificationCollection.Where(x => Array.IndexOf(qualificationIds, (x as LookupItem).Id) >= 0)); string[] licenceIds = objSearchDifinition["parameter"]["TicketLicensesIds"].ToString().Split(','); LicenceSelected = new ObservableCollection <object>(LicenceCollection.Where(x => Array.IndexOf(licenceIds, (x as LookupItem).Id) >= 0)); } else { JobTypeSelected = new ObservableCollection <object>(); CategorySelected = new ObservableCollection <object>(); LocationSelected = new ObservableCollection <object>(); PositionSelected = new ObservableCollection <object>(); SkillSelected = new ObservableCollection <object>(); QualificationSelected = new ObservableCollection <object>(); LicenceSelected = new ObservableCollection <object>(); } await _dialogService.CloseLoadingPopup(pop); }
public CheckBox addTextBox() { SkillCollection skills = new SkillCollection(); foreach (Skill s in skills) { CheckBox txt = new CheckBox(); lstBxSkills.Items.Add(txt); txt.Content = s.SkillTitle; } return(new CheckBox()); }
public void DisplayCollectionGUI(SkillCollection collection) { GUILayout.BeginVertical(); foreach (var skill in collection.SkillDict.Values) { Rect r = EditorGUILayout.BeginVertical(GUILayout.Height(20)); float progress = skill.Cooldown > 0.0f ? (skill.CurrentCooldown / skill.Cooldown) : 1.0f; EditorGUI.ProgressBar(r, progress, skill.Name); GUILayout.FlexibleSpace(); EditorGUILayout.EndVertical(); GUILayout.Space(4); } GUILayout.EndVertical(); }
protected override void Apply(WorldObject target, ref DamageAction[] actions) { if (!(target is Character)) { return; } SkillCollection skills = ((Character)target).Skills; if (skills == null) { return; } skills.TryLearn(SkillId.DualWield); }
void Start() { Prefabs prefabs = GameObject.Instantiate(prefabsPrefab); string user = staging ? "test" : "TheSammyDee"; ILevelFormula minutesFormula = new Quadratic500LevelFormula(); ILevelFormula countableFormula = new CountableLevelFormula(20, minutesFormula); TimeInputManager timeInput = new TimeInputManager(GameObject.Instantiate(prefabs.timeInputViewModel), canvas); SkillCollection skillCollection = new SkillCollection( new JsonDatabase(user, minutesFormula, countableFormula), minutesFormula, countableFormula); SkillsListViewModel listViewModel = new SkillsListViewModel(skillCollection, timeInput, listViewAnchor); }
// Constructor of this viewModel public SkillManagementViewModel() { // 1. Its goind to connect to DAL and bring in the results to all skills // 2. We create objects of type skill and then add that object to our collection DAL dal = new DAL(); DataTable dt = dal.Read("Select * from bit_skill where (STATUS='ACTIVE' or status is null)"); foreach (DataRow dr in dt.Rows) { Skill skill = new Skill(dr); SkillCollection.Add(skill); } LoadFieldNameCombo(); }
/// <summary> /// Initialize this gambit. find the corresponding skill /// </summary> public void Initialize() { SkillCollection skillCollection = Owner.GetComponent <SkillCollection> (); if (skillCollection != null) { Skill = skillCollection.GetSkill <Skill> (SkillId); if (Skill == null) { Debug.LogWarning("Can't find the skill"); } } else { Debug.LogError("No skill collection attached to the owner of this gambit!"); } }
private void CreateSurpriseSkill() { flowLayoutPanel1.Controls.Clear(); flowLayoutPanel1.Controls.Add(addfilterbutton); filters.Clear(); filters.Add("Damage"); filters.Add("MP Cost"); filters.Add("Targets"); filters.Add("Type"); specifiedfilters.Clear(); comboBox1.SelectedItem = (string)SkillCollection.GetSurpriseSkill().Name; }
public void SkillCollection_AddSkill() { ISkillsDataSource database = new MockSkillsDataSource(); SkillCollection skillCollection = new SkillCollection(database, new MockLevelFormula(), new MockLevelFormula()); Dictionary <string, Skill> skills = database.GetAllSkills(); Skill f = skills["f"]; Skill g = skills["g"]; skillCollection.AddSkill("newSkill", Color.black, new List <Skill>() { f, g }); Skill newSkill = skills.Select(x => x.Value).Where(y => y.name == "newSkill").First(); skillCollection.AddRecord(DateTime.Today, 25f, newSkill); Assert.AreEqual(newSkill.records[0], g.records[0]); }
public void TickPassive(OnPassiveCastEventData e) { //early exit if (HasAlreadyAppliedEffect) { return; } SkillCollection SkillCollection = e.Caster.GetComponentInChildren <SkillCollection>(); if (SkillCollection != null) { Skill Charge = SkillCollection.GetNamedSkill("charge"); Charge.GetHandler().OnCastHitTarget.AddListener( OnCastHit ); } HasAlreadyAppliedEffect = true; //do not retick }
public void SkillCollection_can_add_skill() { // AAA - Arrange, Act, Assert // Arrange var sut = new SkillCollection(); ISkill s1 = new Skill { SkillID = 101, Name = "PW7" }; // Act sut.Add(s1); // Assert Assert.Multiple(() => { Assert.That(sut.Count, Is.EqualTo(1)); Assert.That(sut[0].SkillID, Is.EqualTo(101)); Assert.That(sut[0].Name, Is.EqualTo("PW7")); }); }
/// <summary> /// 类型:方法 /// 名称:Character /// 作者:taixihuase /// 作用:通过已有的角色信息构造一个新的角色实例 /// 编写日期:2015/8/20 /// </summary> /// <param name="character"></param> public Character(Character character) : base(character.Guid, character.Account, character.UniqueId, character.Nickname, character.Status) { WorldEnterTime = character.WorldEnterTime; Position = character.Position; Experience = character.Experience; Occupation = character.Occupation; Weapons = character.Weapons; Armors = character.Armors; Jewels = character.Jewels; Skills = character.Skills; Attribute = new CharacterAttribute(); Type type = character.Attribute.GetType(); var pi = type.GetProperties(); foreach (var info in pi) { info.SetValue(Attribute, info.GetValue(character.Attribute, null), null); } }
private void DeleteSkill() { try { if (MessageBox.Show("Are you sure you want to PERMANENTLY delete the skill's details?", "Delete Skill?", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes) { SelectedSkill.Delete(); SkillCollection.Remove(SelectedSkill); MessageBox.Show("Thank you! The Skill's details have been deleted!", "Delete Skill?", MessageBoxButton.OK, MessageBoxImage.Information); } else { return; } } catch (Exception ex) { MessageBox.Show("An Error Occured, The Skill Details have not been deleted. Please Contact your System Administrator.", "Delete Skill?" + ex.Message); } }
public void DeleteSkill() { try { int skillID = SkillCollection[SelectedIndex].ID; var forgeDatabase = Global.Instance.ForgeDatabase(); SKILL skill = forgeDatabase.Skills.Single(x => x.ID == skillID); forgeDatabase.Skills.DeleteOnSubmit(skill); forgeDatabase.SubmitChanges(); SkillCollection.RemoveAt(SelectedIndex); Global.Instance.SkillCollection = new BindableCollection <SkillCollection>(SkillCollection); ClearSkillInfo(); SelectedIndex = -1; } catch { } }
/// <summary> /// Default constructor /// </summary> /// <param name="identity">The identitiy for this character</param> /// <param name="guid"></param> protected Character(CharacterIdentity identity, Guid guid) { m_characterID = identity.CharacterID; m_name = identity.Name; m_identity = identity; m_guid = guid; m_skillGroups = new SkillGroupCollection(this); m_skills = new SkillCollection(this); m_certificateCategories = new CertificateCategoryCollection(this); m_certificateClasses = new CertificateClassCollection(this); m_certificates = new CertificateCollection(this); m_implants = new ImplantSetCollection(this); m_plans = new PlanCollection(this); for (int i = 0; i < m_attributes.Length; i++) { m_attributes[i] = new CharacterAttribute(this, (EveAttribute)i); } m_uiSettings = new CharacterUISettings(); }
private static SkillCollection PopulateSkillCollection(DataTable assignmentSkillsData) { SkillCollection skills = null; if (assignmentSkillsData != null && assignmentSkillsData.Rows.Count > 0) { skills = new SkillCollection(); for (int index = 0; index < assignmentSkillsData.Rows.Count; index++) { skills.Add(new Skill()); skills[index].Code = assignmentSkillsData.Rows[index]["SkillCode"].ToString(); skills[index].Description = assignmentSkillsData.Rows[index]["SkillDesc"].ToString(); } } return skills; }
public Agent() { Implants = new ImplantCollection(); Skills = new SkillCollection(); }