public TheWindArcanian(Vector2 position, PlayerIndex thePlayerIndex) : base(position, thePlayerIndex) { // Initialize texture texArcanianRight = "Arcanian/windBirdRight"; texArcanianLeft = "Arcanian/windBirdLeft"; texDyingRight = "Arcanian/windBirdDead_right"; texDyingLeft = "Arcanian/windBirdDead_left"; texShield = "Arcanian/windshieldsprite"; Texture = texArcanianRight; // Initialize name mName = "Wind Arcanian"; // Initialize shield mShieldArt.SetTextureSpriteSheet(texShield, 4, 1, 0); mShieldArt.UseSpriteSheet = true; // Initliaze wind skills WindBlade windBlade = new WindBlade(); MultipleWindBlade multipleWindBlade = new MultipleWindBlade(); MegaWindBlade megaWindBlade = new MegaWindBlade(); // Initialize skill set with wind skills mSkillSet = new SkillSet(windBlade, multipleWindBlade, megaWindBlade, null); // Add skills to global list of skills //G.ListOfSkills.Add(windBlade); //G.ListOfSkills.Add(multipleWindBlade); //G.ListOfSkills.Add(megaWindBlade); }
public TheFireArcanian(Vector2 position, PlayerIndex thePlayerIndex) : base(position, thePlayerIndex) { // Initialize texture texArcanianRight = "Arcanian/flameFoxRight"; texArcanianLeft = "Arcanian/flameFoxLeft"; texDyingRight = "Arcanian/flameFoxDead_right"; texDyingLeft = "Arcanian/flameFoxDead_left"; texShield = "Arcanian/fireshieldsprite"; Texture = texArcanianRight; // Initialize name mName = "Fire Arcanian"; // Initialize shield mShieldArt.SetTextureSpriteSheet(texShield, 4, 1, 0); mShieldArt.UseSpriteSheet = true; // Initliaze fire skills Fireball fireball = new Fireball(); MultipleFireBall multipleFireBall = new MultipleFireBall(); MegaFireBall megaFireBall = new MegaFireBall(); // Initialize skill set with fire skills mSkillSet = new SkillSet(fireball, multipleFireBall, megaFireBall, null); // Add skills to global list of skills //G.ListOfSkills.Add(fireball); //G.ListOfSkills.Add(multipleFireBall); //G.ListOfSkills.Add(megaFireBall); }
public TheWaterArcanian(Vector2 position, PlayerIndex thePlayerIndex) : base(position, thePlayerIndex) { // Initialize texture texArcanianRight = "Arcanian/waterTurtleRight"; texArcanianLeft = "Arcanian/waterTurtleLeft"; texDyingRight = "Arcanian/waterTurtleDead_right"; texDyingLeft = "Arcanian/waterTurtleDead_left"; texShield = "Arcanian/watershieldsprite"; Texture = texArcanianRight; // Initialize name mName = "Water Arcanian"; // Initialize shield mShieldArt.SetTextureSpriteSheet(texShield, 4, 1, 0); mShieldArt.UseSpriteSheet = true; // Initliaze water skills SingleStream waterStream = new SingleStream(); DoubleWaterStream doubleWaterStream = new DoubleWaterStream(); UltimateWaterStream ultimateWaterStream = new UltimateWaterStream(); // Initialize skill set with water skills mSkillSet = new SkillSet(waterStream, doubleWaterStream, ultimateWaterStream, null); // Add skills to global list of skills //G.ListOfSkills.Add(waterStream); //G.ListOfSkills.Add(doubleWaterStream); //G.ListOfSkills.Add(ultimateWaterStream); // Initialize HP Regen mHPRegenTimer = 0; }
// Use this for initialization void Start () { Sync(); //Get info from central skillSet = GameObject.Find("SkillSet").GetComponent<SkillSet>(); hp = max_hp; InitUI(); gemHolder_obj = GameObject.FindGameObjectWithTag ("GemHolder"); gemHolder_scr = gemHolder_obj.GetComponent<GemHolder> (); // DisplayHpBar(); }
protected override void OnSetUp() { using (ISession session = OpenSession()) { SkillSet skillSet = new SkillSet() { Code = "123", Title = "Skill Set" }; Qualification qualification = new Qualification() { Code = "124", Title = "Qualification" }; session.Save(skillSet); session.Save(qualification); session.Flush(); } }
public IList<Core.Competency.Competency> GetAllCompetenciesForASkillSet(SkillSet skillSet) { IList<Core.Competency.Competency> competenciesForSkillSet = new List<Core.Competency.Competency>(); if (skillSet != null && skillSet.Competencies != null && skillSet.Competencies.Count > 0) { foreach (string competencyGuid in skillSet.Competencies) { Core.Competency.Competency competency = _competencyService.GetCompetency(competencyGuid); if (competency != null && competency.Name != null) { competenciesForSkillSet.Add(competency); } } } competenciesForSkillSet = competenciesForSkillSet.Distinct().ToList(); return competenciesForSkillSet; }
// GET: Lecturer/Delete/5 public ActionResult SkillSetDelete(int?id) { if ((HttpContext.Session.GetString("Role") == null) || (HttpContext.Session.GetString("Role") != "Lecturer")) { return(RedirectToAction("Index", "Home")); } if (id == null) { return(RedirectToAction("Index")); } SkillSet skillSet = SkillSetContext.GetDetails(id.Value); if (skillSet == null) { return(RedirectToAction("Index")); } return(View(skillSet)); }
public ActionResult GetSkillSet(int id) { // Retrieve the Skillset for id SkillSet skillset = null; using (EPortfolioDB database = new EPortfolioDB()) { skillset = database.SkillSets .Where(s => s.SkillSetId == id) .FirstOrDefault(); } // check if skill has been found for targetId if (skillset == null) { return(NotFound()); } return(Json(skillset)); }
void SetSkillSet(IRocketPlayer caller, string skillSetName) { SkillSet skillSet = SkillsUtils.FindSkillSetByName(skillSetName); if (skillSet == null) { UnturnedChat.Say(caller, string.Format("Unknown SkillSet \"{0}\"", skillSetName)); return; } if (!IsPermitted(caller, skillSet)) { CommandUtils.PermissionMissing(caller); return; } SkillsUtils.SetSkills((UnturnedPlayer)caller, skillSetName); bool saved = SkillSetsPlugin.Instance.GetStorage().Save(((UnturnedPlayer)caller).CSteamID, skillSetName); UnturnedChat.Say(caller, SkillSetsPlugin.Instance.Translate("SKILLSET_APPLIED")); }
/// <summary> /// Delete the skill from the db. The skills are found via their ids and deleted from the ComapnySkills table. They are then delete from the Skillset table /// </summary> /// <param name="selectedSkill"></param> /// <returns></returns> public async Task DeleteSkillFromDb(SkillSet selectedSkill) { try { var tempSkills = _context.CompanySkills.Where(s => s.SkillId == selectedSkill.SkillId).ToList(); foreach (var skill in tempSkills) { _context.CompanySkills.RemoveRange(skill); } _context.SkillSet.Remove(selectedSkill); await _context.SaveChangesAsync(); } catch (Exception e) { Console.WriteLine(e.Message); throw; } }
public ActionResult Create([Bind(Include = "SkillSetId,Name")] SkillSet skillset) { try { if (ModelState.IsValid) { skillset.Type = 1; db.SkillSets.Add(skillset); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(skillset)); } catch (Exception exp) { Logger.LogException(exp); return(RedirectToAction("AppError", "Error")); } }
public static SkillSet <PageImage> CreateCognitiveSkillSet() { var skillSet = SkillSet <PageImage> .Create("page", page => page.Id); // prepare the image var resizedImage = skillSet.AddSkill("resized-image", page => page.GetImage().ResizeFit(2000, 2000).CorrectOrientation().UploadMedia(blobContainer), skillSet.Input); // Run OCR on the image using the Vision API var cogOcr = skillSet.AddSkill("ocr-result", imgRef => visionClient.RecognizeTextAsync(imgRef.Url), resizedImage); // extract text from handwriting var handwriting = skillSet.AddSkill("ocr-handwriting", imgRef => visionClient.GetHandwritingTextAsync(imgRef.Url), resizedImage); // Get image descriptions for photos using the computer vision var vision = skillSet.AddSkill("computer-vision", imgRef => visionClient.AnalyzeImageAsync(imgRef.Url, new[] { VisualFeature.Tags, VisualFeature.Description }), resizedImage); // extract entities linked to wikipedia using the Entity Linking Service var linkedEntities = skillSet.AddSkill("linked-entities", (ocr, hw, vis) => GetLinkedEntitiesAsync(ocr.Text, hw.Text, vis.Description.Captions[0].Text), cogOcr, handwriting, vision); // combine the data as an annotated document var cryptonyms = skillSet.AddSkill("cia-cryptonyms", ocr => DetectCIACryptonyms(ocr.Text), cogOcr); // combine the data as an annotated page that can be used by the UI var pageContent = skillSet.AddSkill("page-metadata", CombineMetadata, cogOcr, handwriting, vision, cryptonyms, linkedEntities, resizedImage); return(skillSet); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); // Access some class members to force the static constructors to run. object dummy = AllAbilities.PSPNames; dummy = PSPResources.Lists.AbilityAttributes; dummy = PSXResources.Lists.AbilityAttributes; dummy = SkillSet.GetDummySkillSets(PatcherLib.Datatypes.Context.US_PSX); dummy = AllMonsterSkills.PSXNames; dummy = AllJobs.GetNames(PatcherLib.Datatypes.Context.US_PSX); dummy = ActionMenuEntry.AllActionMenuEntries; dummy = ShopAvailability.GetAllAvailabilities(PatcherLib.Datatypes.Context.US_PSX); dummy = SpriteSet.GetSpriteSets(PatcherLib.Datatypes.Context.US_PSX); dummy = SpecialName.GetSpecialNames(PatcherLib.Datatypes.Context.US_PSX); dummy = Event.GetEventNames(PatcherLib.Datatypes.Context.US_PSX); Application.Run(new MainForm()); }
public IActionResult create(SkillSet skill) { Guid obj = Guid.NewGuid(); string gid = obj.ToString(); if (skill.Parent == "") { skill.Id = gid; skill.Parent = null; _context.SkillSets.Add(skill); _context.SaveChanges(); } else { skill.Id = gid; _context.SkillSets.Add(skill); _context.SaveChanges(); } return(CreatedAtRoute("GetToskills", new { id = skill.Id }, skill)); }
public void Start() { // Update distances distFront *= range; distNear *= range; distMin *= range; //targetery = Instantiate(targetery, transform.position, transform.rotation) as GameObject; //targeter = targetery.GetComponent<Targeter>(); searchTarget = new GameObject("searchTarget"); skillsRef = gameObject.GetComponent<SkillSet>(); weaponsRef = gameObject.GetComponent<ShipWeapons>(); if(skillsRef == null) { Debug.Log("FAIL"); } UnlockAi(); }
public async Task <ProjectDto> Get(int projectID) { ProjectDto projectDto = null; Project project = null; try { using (var _context = new DatabaseContext()) { project = await _context.Project.Where(x => x.Id == projectID).FirstOrDefaultAsync <Project>(); projectDto = mapProjectToProjectDto(project); projectDto.primarySkillIds = new List <SkillSet>(); projectDto.secondarySkillIds = new List <SkillSet>(); ProjectSkills projectSkills = new ProjectSkills(); projectSkills = await _context.ProjectSkills.Where(x => x.ProjectId == projectID).FirstOrDefaultAsync <ProjectSkills>(); String[] primary = projectSkills.PrimarySkillIds.Split(','); String[] secondary = projectSkills.SecondarySkillIds.Split(','); foreach (String id in primary) { SkillSet skill = await skillSetService.Get(Int32.Parse(id)); projectDto.primarySkillIds.Add(skill); } foreach (String id in secondary) { SkillSet skill = await skillSetService.Get(Int32.Parse(id)); projectDto.secondarySkillIds.Add(skill); } } return(projectDto); } catch (Exception) { throw; } }
public void Start() { // Update distances distFront *= range; distNear *= range; distMin *= range; //targetery = Instantiate(targetery, transform.position, transform.rotation) as GameObject; //targeter = targetery.GetComponent<Targeter>(); searchTarget = new GameObject("searchTarget"); skillsRef = gameObject.GetComponent <SkillSet>(); weaponsRef = gameObject.GetComponent <ShipWeapons>(); if (skillsRef == null) { Debug.Log("FAIL"); } UnlockAi(); }
} // end of ChooseResourcesForAction #endregion #region CheckAvailabilityOfDoctors /// <summary> /// Checks if all skills of doctors are currently controlled by the control unit /// </summary> /// <param name="mainDocSkill">Skill required for main doctor</param> /// <param name="reqAssSkills">Skills required for assisting doctors</param> /// <returns>True if all skills are controlled</returns> public List <SkillSet> CheckAvailabilityOfDoctors(SkillSet mainDocSkill, SkillSet[] reqAssSkills) { //-------------------------------------------------------------------------------------------------- // At the moment it is assumed that the main doctoral skkill set is always available //-------------------------------------------------------------------------------------------------- List <SkillSet> nonAvailableSkillSets = new List <SkillSet>(); List <EntityDoctor> nonChosenDoctors = new List <EntityDoctor>(ControlledDoctors); if (reqAssSkills == null) { return(nonAvailableSkillSets); } foreach (SkillSet skillSet in reqAssSkills) { EntityDoctor foundDoc = null; foreach (EntityDoctor doc in nonChosenDoctors) { if (doc.SatisfiesSkillSet(skillSet)) { foundDoc = doc; break; } // end if } // end foreach if (foundDoc == null) { nonAvailableSkillSets.Add(skillSet); } else { nonChosenDoctors.Remove(foundDoc); } } // end foreach return(nonAvailableSkillSets); } // end of CheckAvailabilityOfDoctors
public SkillSet GetDetails(int SkillSetId) { //Instantiate a SqlCommand object, supply it with a SELECT SQL //statement which retrieves all attributes of a staff record. SqlCommand cmd = new SqlCommand ("SELECT * FROM SKillset WHERE SKillsetID = @selectedSkillsetID", conn); cmd.Parameters.AddWithValue("@selectedSkillsetID", SkillSetId); //Instantiate a DataAdapter object, pass the SqlCommand //object “cmd” as parameter. SqlDataAdapter da = new SqlDataAdapter(cmd); //Create a DataSet object “result" DataSet result = new DataSet(); //Open a database connection. conn.Open(); //Use DataAdapter to fetch data to a table. da.Fill(result, "SkillsetDetails"); //Close the database connection conn.Close(); SkillSet skillset = new SkillSet(); if (result.Tables["SkillsetDetails"].Rows.Count > 0) { skillset.SkillSetId = SkillSetId; // Fill SkillSet object with values from the DataSet DataTable table = result.Tables["SkillsetDetails"]; if (!DBNull.Value.Equals(table.Rows[0]["SkillSetName"])) { skillset.SkillSetName = table.Rows[0]["SkillSetName"].ToString(); } return(skillset); // No error occurs } else { return(null); // Record not found } }
public override void ApplySkillChanges(SkillSet set, ActiveSkill melee) { SneezeShot skill = set.GetSkill(SkillId.SneezeShot) as SneezeShot; if (skill == null) { return; } temp = skill.range; temp2 = skill.aimArea; temp3 = skill.interpolAdd; temp4 = skill.projectilesCount; skill.penetrateTargets = true; skill.range = skill.range * 2; skill.projectilesCount = 1; skill.maxPenetratedTargets += 4; skill.aimArea = skill.range; skill.interpolAdd = 1f; skill.navigateAfterPenetration = true; }
public static void SetSkills(UnturnedPlayer player, SkillSet skillSet) { if (skillSet == null || !PermissionUtils.IsPermitted(player, skillSet)) { return; } List <Skill> skills = skillSet.Skills; UnturnedSkill[] allSkills = GetAllUnturnedSkills(); foreach (UnturnedSkill uSkill in allSkills) { Skill skill = skills.Find((Skill _skill) => _skill.USkill.Equals(uSkill)); if (skill != null) { player.SetSkillLevel(skill.USkill, skill.Level); } else { player.SetSkillLevel(uSkill, 0); } } }
// GET: SkillSet/Edit/5 public ActionResult SkillSetEdit(int?id) { // Stop accessing the action if not logged in // or account not in the "Staff" role if ((HttpContext.Session.GetString("Role") == null) || (HttpContext.Session.GetString("Role") != "Lecturer")) { return(RedirectToAction("Index", "Home")); } if (id == null) //Query string parameter not provided { //Return to listing page, not allowed to edit return(RedirectToAction("Index")); } SkillSet skillset = SkillSetContext.GetDetails(id.Value); if (skillset == null) { //Return to listing page, not allowed to edit return(RedirectToAction("Index")); } return(View(skillset)); }
public override void InitSkillsOnMonster(SkillSet set, ActiveSkill meleeSkill, int level) { ProjectileAllAround sk = set.GetSkill(SkillId.ProjectileAllAround) as ProjectileAllAround; sk.baseDamage = 10; sk.projectileCount = 12; sk.range = 30; sk.castTime = 0; sk.reuse = 0f; sk.force = 30; CollisionDamageAttack sk2 = set.GetSkill(SkillId.CollisionDamageAttack) as CollisionDamageAttack; sk2.baseDamage = 5; sk2.pushForce = 100; sk2.reuse = 1f; JumpShort sk3 = set.GetSkill(SkillId.JumpShort) as JumpShort; sk3.jumpSpeed = 45; sk3.range = 7; sk3.reuse = 0f; }
public void SaveSkillsSet(int Id, string Value, string Description, string SkillValueIds, string ImahePath, int UserId) { if (Id > 0) { SkillSet SkillSets = _db.SkillSets.Where(x => x.Id == Id).FirstOrDefault(); SkillSets.Name = Value; SkillSets.Description = Description; if (!string.IsNullOrEmpty(ImahePath)) { SkillSets.Picture = ImahePath; } SkillSets.Date = DateTime.Now; SkillSets.TechnicalSkillsCSV = SkillValueIds; SkillSets.UserIDLastModifiedBy = UserId; SkillSets.LastModified = DateTime.Now; _db.SaveChanges(); } else { SkillSet SkillSets = new SkillSet(); SkillSets.Name = Value; SkillSets.Description = Description; SkillSets.Picture = ImahePath; SkillSets.Date = DateTime.Now; SkillSets.Archived = false; SkillSets.UserIDCreatedBy = UserId; SkillSets.CreatedDate = DateTime.Now; SkillSets.UserIDLastModifiedBy = UserId; SkillSets.LastModified = DateTime.Now; SkillSets.TechnicalSkillsCSV = SkillValueIds; SkillSets.SkillType = "Technical Skills"; _db.SkillSets.Add(SkillSets); _db.SaveChanges(); } }
protected override async Task <bool> ExecuteCommand(IDiscordBot bot, SocketMessage message, RegisterOption option) { var userId = message.Author.Id; using (var dbContext = _dbContextFactory.Create()) { var existingUser = dbContext.Users.FirstOrDefault(t => t.DiscordId == userId); if (existingUser != null) { await message.Channel.SendMessageAsync($"{message.Author.Username} already has a registered user."); } else { var skillSet = new SkillSet(); skillSet.Init(); var applicationUser = new ApplicationUser { DiscordId = userId, UserName = message.Author.Username, NormalizedUserName = message.Author.Username.ToUpper(), Id = userId.ToString(), PasswordHash = "TestAtm", SkillSet = skillSet, CurrentTask = new CurrentTask { Notified = true, UserId = userId.ToString(), UnlockTime = DateTime.MinValue }, Mention = message.Author.Mention }; dbContext.Add(applicationUser); await dbContext.SaveChangesAsync(); await message.Channel.SendMessageAsync($"{message.Author.Username} has registered their user. Type +help for commands. Each command has a --help switch .e.g. +buy --help."); } } return(true); }
// PUT: odata/SkillSets(5) public async Task <IHttpActionResult> Put([FromODataUri] int key, Delta <SkillSet> patch) { Validate(patch.GetEntity()); if (!ModelState.IsValid) { return(BadRequest(ModelState)); } SkillSet skillSet = await db.SkillSets.FindAsync(key); if (skillSet == null) { return(NotFound()); } patch.Put(skillSet); try { await db.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SkillSetExists(key)) { return(NotFound()); } else { throw; } } return(Updated(skillSet)); }
public ActionResult AssignSkillSet(int id, [FromQuery] int student) { using (EPortfolioDB database = new EPortfolioDB()) { // check if student skillset already exists in the database IQueryable <StudentSkillSet> matchingAssignments = database .StudentSkillSets .Where(s => s.SkillSetId == id) .Where(s => s.StudentId == student); if (matchingAssignments.Count() >= 1) { return(Ok()); // skillset already assigned to student } // obtain models for the specified by the given request SkillSet skillSetModel = database.SkillSets .Where(s => s.SkillSetId == id).FirstOrDefault(); Student studentModel = database.Students .Where(s => s.StudentId == student).FirstOrDefault(); if (skillSetModel == null || studentModel == null) { return(NotFound()); } // assign the skillset to the student StudentSkillSet assignment = new StudentSkillSet { Student = studentModel, SkillSet = skillSetModel }; database.StudentSkillSets.Add(assignment); database.SaveChanges(); } return(Ok()); }
//[Authenticate("Lecturer")] public ActionResult CreateSkillSet([FromBody] SkillSetFormModel formModel) { // check if contents of form model is valid if (!ModelState.IsValid) { return(BadRequest(ModelState)); } // write the given skillset to database int skillSetId = -1; using (EPortfolioDB database = new EPortfolioDB()) { // check if skillset name does not conflict with existing skillset if (database.SkillSets .Where(s => s.SkillSetName == formModel.SkillSetName) .Count() >= 1) { return(SkillSetNameConflict); } // create skillSet with form model values SkillSet skillSet = new SkillSet(); formModel.Apply(skillSet); // add new skillset to database database.SkillSets.Add(skillSet); database.SaveChanges(); skillSetId = skillSet.SkillSetId; } // respond with sucess message with inserted skillset id Object response = new { skillSetId = skillSetId }; return(Json(response)); }
public override bool Perform() { char terrain = GameController.Instance.Level.Map[position]; if (terrain == Terrain.Get("wall").Character) { if (performer is IEquipmentBeing && performer is ISkillsBeing) { Equipment equipment = (performer as IEquipmentBeing).Equipment; EquipmentSlot slot = equipment["weapon-slot"]; SkillSet skills = (performer as ISkillsBeing).Skills; Skill diggingSkill = skills["digging"]; if (slot != null && slot.Item != null && slot.Item.HasTag("digging") && diggingSkill != null) { return(doDig()); } } else { return(doDig()); } } return(false); }
/// <summary> /// Saves the skill set information. /// </summary> /// <param name="skillSetInfo">The skill set information.</param> /// <returns></returns> /// <exception cref="ArgumentNullException">skillSetInfo</exception> public string SaveSkillSetInfo(ISkillSetModelView skillSetInfo) { if (skillSetInfo == null) { throw new ArgumentNullException(nameof(skillSetInfo)); } var result = string.Empty; var newRecord = new SkillSet { SkillName = skillSetInfo.SkillName, SkillDescription = skillSetInfo.SkillDescription, EmployeeId = skillSetInfo.EmployeeId, ExperienceId = skillSetInfo.Experience, IsActive = true, DateCreated = DateTime.UtcNow }; try { using ( var dbContext = (HRMSEntities)this.dbContextFactory.GetDbContext(ObjectContextType.HRMS)) { dbContext.SkillSets.Add(newRecord); dbContext.SaveChanges(); } } catch (Exception e) { result = string.Format("SaveSkillSetInfo - {0} , {1}", e.Message, e.InnerException != null ? e.InnerException.InnerException.Message : ""); } return(result); }
// Loads skill values from storage. Generates new values and saves them if none exist. public void InitializeSkillSet() { // Instantiate SkillSet. if (!skillSet.name.Contains(id.ToString())) { skillSet = Instantiate(skillSet); // Instantiate every Skill in the SkillSet. foreach (Skill s in skillSet.Skills.ToArray()) { Skill newSkill = skillSet.Skills[skillSet.Skills.IndexOf(s)] = Instantiate(s); newSkill.name = newSkill.name.Replace("(Clone) ", id.ToString()); // Replace "(Clone)" with the colonist ID on each obj. } skillSet.name = skillSet.name.Replace("(Clone) ", id.ToString()); } // Generate random values for each skill if no saved data for the Colonist exists (mapped by the ID). // Otherwise, if there is data, load it. if (!System.IO.File.Exists(Application.persistentDataPath + id)) { skillSet.GenerateSkillValues(id, traits); return; } skillSet.LoadSkills(id); }
private void UpdateDataSources() { foreach (ComboBoxWithDefault itemComboBox in new ComboBoxWithDefault[] { rightHandComboBox, leftHandComboBox, headComboBox, bodyComboBox, accessoryComboBox, warTrophyComboBox }) { itemComboBox.BindingContext = new BindingContext(); itemComboBox.DataSource = Item.GetEventItems(ourContext); } primarySkillComboBox.BindingContext = new BindingContext(); primarySkillComboBox.DataSource = new List <SkillSet>(SkillSet.GetEventSkillSets(ourContext).Values); secondaryActionComboBox.BindingContext = new BindingContext(); secondaryActionComboBox.DataSource = new List <SkillSet>(SkillSet.GetEventSkillSets(ourContext).Values); foreach (ComboBoxWithDefault abilityComboBox in new ComboBoxWithDefault[] { reactionComboBox, supportComboBox, movementComboBox }) { abilityComboBox.BindingContext = new BindingContext(); abilityComboBox.DataSource = AllAbilities.GetEventAbilities(ourContext); } faithComboBox.BindingContext = new BindingContext(); faithComboBox.DataSource = zeroTo100; braveryComboBox.BindingContext = new BindingContext(); braveryComboBox.DataSource = zeroTo100; dayComboBox.DataSource = zeroTo31; levelComboBox.DataSource = levelStrings; experienceComboBox.DataSource = byteNumberWithRandom; spriteSetComboBox.DataSource = SpriteSet.GetSpriteSets(ourContext); specialNameComboBox.DataSource = SpecialName.GetSpecialNames(ourContext); jobComboBox.DataSource = AllJobs.GetDummyJobs(ourContext); monthComboBox.DataSource = Enum.GetValues(typeof(Month)); teamColorComboBox.DataSource = Enum.GetValues(typeof(TeamColor)); facingDirectionComboBox.DataSource = Enum.GetValues(typeof(Facing)); preRequisiteJobComboBox.DataSource = Enum.GetValues(typeof(PreRequisiteJob)); }
/// <summary> /// Constructor which uses a default ID generation /// </summary> /// <param name="skillSet">Skill set of generated nurse</param> public EntityNurse(SkillSet skillSet) : base(RunningID++, skillSet) { } // end of EntityDoctor
public UserCharacter(string id, SaveData.Character character) { Id = EnumHelper.ParseOrDefault<CharacterId>(id); Data = CharacterDb._.Find(Id); SkillSet = character.SkillSet ?? CharacterBalance._.Find(Id).SkillSetDefault.Clone(); }
public virtual void InitSkillsOnMonster(SkillSet set, ActiveSkill meleeSkill, int level) { }
public IList<AutoCompleteProxy> GetFormattedCompetenciesForSkillSet(SkillSet skillSetObj) { IList<AutoCompleteProxy> formattedCompetencyList = null; if (skillSetObj != null && skillSetObj.Competencies != null && skillSetObj.Competencies.Count > 0) { IList<Core.Competency.Competency> competencyList = GetCompetenciesForSkillSet(skillSetObj); if (competencyList != null && competencyList.Count > 0) { formattedCompetencyList = _competencyService.GetCompetenciesStringListInFormat(competencyList); } } return formattedCompetencyList; }
public int GetSkillSetPiecesObtained(SkillSet set) { return(set.Skills.Count(s => IsKnown(s.Id))); }
public PatniEmployee(int orgCode, int id, string fname, double salary) : base (id, fname, salary) { OrgCode = orgCode; Skills = new SkillSet("vb", "c#", "asp.net"); }
void Populate(Alliances alliance, List<Unit> team, List<Tile> openTiles) { for (int i = 0; i < 6; ++i) { int rnd = UnityEngine.Random.Range(0, openTiles.Count); Tile tile = openTiles[rnd]; openTiles.RemoveAt(rnd); int lvl = UnityEngine.Random.Range(7, 11); Unit unit = alliance == Alliances.Hero ? UnitFactory.CreateHero(lvl) : UnitFactory.CreateMonster(lvl); unit.alliance = alliance; team.Add(unit); unit.Place(tile); unit.Dir = (Directions)UnityEngine.Random.Range(0, 4); unit.Match(); SkillSet atk = new SkillSet(); atk.name = "Attack"; atk.skills.Add(Resources.Load<Ability>("Abilities/_lightAttack")); // atk.skills.Add(Resources.Load<Ability>("Abilities/_mediumAttack")); // atk.skills.Add(Resources.Load<Ability>("Abilities/_heavyAttack")); unit.capability.Add(atk); SkillSet temp = new SkillSet(); temp.name = "Black Magic"; temp.skills.Add(Resources.Load<Ability>("Abilities/Fire")); unit.capability.Add(temp); turnController.AddUnit(unit); } }
/// <summary> /// to set and get dynamic url for skill /// </summary> /// <param name="skillSetObjFromUi"></param> /// <param name="dropBox"> </param> /// <param name="skillSetUrl"></param> /// <param name="isEditMode"></param> /// <param name="folderIdentifier"></param> /// <returns></returns> private string FormAndSetUrlForSkillSet(SkillSet skillSetObjFromUi, DropBoxLink dropBox, string skillSetUrl, bool isEditMode, string folderIdentifier) { if (isEditMode) { return skillSetUrl; } if (String.IsNullOrEmpty(skillSetUrl) && String.IsNullOrEmpty(folderIdentifier)) { return string.Format(_skillSetDocument.GetAssignmentUrl(dropBox,DocumentPath.Module.SkillSets,AppConstants.Create), skillSetUrl, skillSetObjFromUi.GetNewGuidValue()); } if (String.IsNullOrEmpty(skillSetUrl) && !String.IsNullOrEmpty(folderIdentifier)) { return folderIdentifier + "/"+Respository.Skillsets + "/" + skillSetObjFromUi.GetNewGuidValue(); } return String.Empty; }
private IList<Core.Competency.Competency> GetCompetenciesForSkillSet(SkillSet skillSetObj) { IList<Core.Competency.Competency> competencyList = new List<Core.Competency.Competency>(); if (skillSetObj.Competencies != null && skillSetObj.Competencies.Count > 0) { foreach (string competencyId in skillSetObj.Competencies) { Core.Competency.Competency competency = _competencyService.GetCompetency(competencyId); if (competency != null) { competencyList.Add(competency); } } } return competencyList; }
public void SwapSkillSetSave(SkillSet skillSetObjToSave, string skillSetUrl) { string strUrlToSave = FormAndSetUrlForSkillSet(skillSetObjToSave, null, skillSetUrl, true, ""); _skillSetDocument.SaveOrUpdate(strUrlToSave, skillSetObjToSave); }
//public bool SaveSkillStructure(string uniqueIdentifier, Dictionary<string, Question> selectQuestionOrderList) //{ // _questionDocument.SaveOrUpdate(uniqueIdentifier, selectQuestionOrderList); // return true; //} public bool SaveSkillStructure(string uniqueIdentifierUrl, List<DocumentProxy> documentProxyQuestionOrderList) { SkillSet skillSetToSave = new SkillSet {Questions = new Dictionary<string, Question>()}; List<DocumentProxy> selectQuestionTemplateList = documentProxyQuestionOrderList.Where(qusTemp => qusTemp.IsQuestionFromTemplate).ToList(); List<DocumentProxy> selectQuestionBankList = documentProxyQuestionOrderList.Where(qusTemp => !(qusTemp.IsQuestionFromTemplate)).ToList(); foreach (DocumentProxy docProxyQuestionBank in selectQuestionBankList) { if (!AppCommon.CheckIfStringIsEmptyOrNull(docProxyQuestionBank.ParentReferenceGuid)) { Question questionFromSkillSet = _questionBankService.GetQuestion(docProxyQuestionBank.Url); questionFromSkillSet.SequenceNumber = docProxyQuestionBank.OrderSequenceNumber; questionFromSkillSet.CreatedBy = docProxyQuestionBank.CreatedBy; questionFromSkillSet.CreatedTimeStamp = docProxyQuestionBank.CreatedTimeStamp; skillSetToSave.Questions.Add(docProxyQuestionBank.UniqueIdentifier, questionFromSkillSet); } else { Question question = _questionBankService.GetQuestion(docProxyQuestionBank.Url); _questionBankService.CloneImagesForQuestion(question); string newGuidQuestionBank = question.GetNewGuidValue(); question.Url = uniqueIdentifierUrl + "/Questions/" + newGuidQuestionBank; question.ParentReferenceGuid = docProxyQuestionBank.Url; question.CreatedBy = docProxyQuestionBank.CreatedBy; question.CreatedTimeStamp = docProxyQuestionBank.CreatedTimeStamp; skillSetToSave.Questions.Add(newGuidQuestionBank, question); } } foreach (DocumentProxy docProxyQuestionTemplate in selectQuestionTemplateList) { if (!AppCommon.CheckIfStringIsEmptyOrNull(docProxyQuestionTemplate.Url)) { // ----------------- step 2 already saved question -------------- Question docQusTempExist = _questionBankService.GetQuestion(docProxyQuestionTemplate.Url); docQusTempExist.SequenceNumber = docProxyQuestionTemplate.OrderSequenceNumber; docQusTempExist.CreatedBy = docProxyQuestionTemplate.CreatedBy; docQusTempExist.CreatedTimeStamp = docProxyQuestionTemplate.CreatedTimeStamp; docQusTempExist.IsAutoSave = docProxyQuestionTemplate.IsAutoSave; docQusTempExist.IsActive = docProxyQuestionTemplate.IsActive; string uniqueIdentifierAlreadySavedQuestionBank = (!String.IsNullOrEmpty(docProxyQuestionTemplate.Url) ? docProxyQuestionTemplate.Url.Split('/').Last() : String.Empty); skillSetToSave.Questions.Add(uniqueIdentifierAlreadySavedQuestionBank, docQusTempExist); } else { // ----------------- step 2 new saved question -------------- Question questionTemplate = new Question { QuestionText = docProxyQuestionTemplate.Text, QuestionType = docProxyQuestionTemplate.TypeOfQuestion, SequenceNumber = docProxyQuestionTemplate.OrderSequenceNumber, IsQuestionFromTemplate = docProxyQuestionTemplate.IsQuestionFromTemplate, TemplateSequenceNumber = docProxyQuestionTemplate.TemplateSequenceNumber, CreatedBy = docProxyQuestionTemplate.CreatedBy, CreatedTimeStamp = docProxyQuestionTemplate.CreatedTimeStamp }; string newGuidQuestion = questionTemplate.GetNewGuidValue(); questionTemplate.Url = uniqueIdentifierUrl + "/Questions/" + newGuidQuestion; skillSetToSave.Questions.Add(newGuidQuestion, questionTemplate); } } string identifierUrl = uniqueIdentifierUrl + "/Questions"; _questionDocument.SaveOrUpdate(identifierUrl, skillSetToSave.Questions); return true; }
public bool SaveSkillSet(SkillSet skillSetObjectFromUi, DropBoxLink dropBox, string skillSetUrl, string folderIdentifier, bool isEditMode, out string skillSetIdentifier) { try { // Set Guid referncce and Correct Url string strUrlToSave = FormAndSetUrlForSkillSet(skillSetObjectFromUi, dropBox, skillSetUrl, isEditMode, folderIdentifier); skillSetIdentifier = strUrlToSave; if (isEditMode) { SkillSet skillSetObj = _skillSetDocument.GetSkillSet(strUrlToSave); skillSetObj.Competencies = skillSetObjectFromUi.Competencies; skillSetObj.Focus = skillSetObjectFromUi.Focus; skillSetObj.SkillSetTitle = skillSetObjectFromUi.SkillSetTitle; skillSetObj.SequenceNumber = skillSetObjectFromUi.SequenceNumber; skillSetObj.Url = strUrlToSave; List<string> lstOfGuidsForQuestions = new List<string>(); if (skillSetObj.Questions != null && skillSetObj.Questions.Count > 0) { lstOfGuidsForQuestions.AddRange(from item in skillSetObj.Questions let questionObj = item.Value where !String.IsNullOrEmpty(questionObj.CompetencyReferenceGuid) where !skillSetObj.Competencies.Contains(questionObj.CompetencyReferenceGuid) select item.Key); foreach (var itemGuids in lstOfGuidsForQuestions) { skillSetObj.Questions.Remove(itemGuids); } } _skillSetDocument.SaveOrUpdate(strUrlToSave, skillSetObj); } else { skillSetObjectFromUi.Url = strUrlToSave; _skillSetDocument.SaveOrUpdate(strUrlToSave, skillSetObjectFromUi); } } catch { skillSetIdentifier = String.Empty; return false; } return true; }
} // end of EntityDoctor /// <summary> /// Constructor that uses an ID specified by user /// </summary> /// <param name="ID">ID of nurse</param> /// <param name="skillSet">Skill set of generated nurse</param> public EntityNurse(int ID, SkillSet skillSet) : base(ID, skillSet) { } // end of EntityDoctor
public Character(SkillSet skillSet) { SkillSet = skillSet; }
public void UpdateView(Context context) { ignoreChanges = true; this.SuspendLayout(); absorbElementsEditor.SuspendLayout(); cancelElementsEditor.SuspendLayout(); halfElementsEditor.SuspendLayout(); weakElementsEditor.SuspendLayout(); equipmentEditor.SuspendLayout(); innateStatusesEditor.SuspendLayout(); statusImmunityEditor.SuspendLayout(); startingStatusesEditor.SuspendLayout(); if (ourContext != context) { ourContext = context; skillsetComboBox.Items.Clear(); skillsetComboBox.Items.AddRange(SkillSet.GetDummySkillSets(context)); foreach (ComboBoxWithDefault cb in new ComboBoxWithDefault[] { innateAComboBox, innateBComboBox, innateCComboBox, innateDComboBox }) { cb.Items.Clear(); cb.Items.AddRange(AllAbilities.GetDummyAbilities(context)); } cmb_MPortrait.Items.Clear(); cmb_MType.Items.Clear(); System.Collections.Generic.IList <string> spriteNames = (ourContext == Context.US_PSX) ? PSXResources.Lists.SpriteFiles : PSPResources.Lists.SpriteFiles; int spriteNameCount = spriteNames.Count; cmb_MPortrait.Items.Add("00"); cmb_MType.Items.Add("00"); for (int index = 1; index < spriteNameCount; index++) { string spriteName = spriteNames[index]; cmb_MPortrait.Items.Add(String.Format("{0} {1}", (index).ToString("X2"), spriteName)); if ((index >= 0x86) && (index <= 0x9A)) { cmb_MType.Items.Add(String.Format("{0} {1}", (index - 0x85).ToString("X2"), spriteName)); } } for (int index = cmb_MType.Items.Count; index <= spriteNameCount; index++) { cmb_MType.Items.Add(index.ToString("X2")); } for (int index = (spriteNameCount + 1); index < 0x100; index++) { cmb_MPortrait.Items.Add(index.ToString("X2")); cmb_MType.Items.Add(index.ToString("X2")); } } skillsetComboBox.SetValueAndDefault(job.SkillSet, job.Default.SkillSet, toolTip); foreach (NumericUpDownWithDefault s in spinners) { // TODO Update Default s.SetValueAndDefault( ReflectionHelpers.GetFieldOrProperty <byte>(job, s.Tag.ToString()), ReflectionHelpers.GetFieldOrProperty <byte>(job.Default, s.Tag.ToString()), toolTip); } innateAComboBox.SetValueAndDefault(job.InnateA, job.Default.InnateA, toolTip); innateBComboBox.SetValueAndDefault(job.InnateB, job.Default.InnateB, toolTip); innateCComboBox.SetValueAndDefault(job.InnateC, job.Default.InnateC, toolTip); innateDComboBox.SetValueAndDefault(job.InnateD, job.Default.InnateD, toolTip); cmb_MPortrait.SetValueAndDefault(cmb_MPortrait.Items[job.MPortrait], cmb_MPortrait.Items[job.Default.MPortrait], toolTip); cmb_MType.SetValueAndDefault(cmb_MType.Items[job.MGraphic], cmb_MPortrait.Items[job.Default.MGraphic], toolTip); absorbElementsEditor.SetValueAndDefaults(job.AbsorbElement, job.Default.AbsorbElement); halfElementsEditor.SetValueAndDefaults(job.HalfElement, job.Default.HalfElement); cancelElementsEditor.SetValueAndDefaults(job.CancelElement, job.Default.CancelElement); weakElementsEditor.SetValueAndDefaults(job.WeakElement, job.Default.WeakElement); equipmentEditor.Equipment = null; //equipmentEditor.Equipment = job.Equipment; equipmentEditor.SetEquipment(job.Equipment, context); innateStatusesEditor.Statuses = null; statusImmunityEditor.Statuses = null; startingStatusesEditor.Statuses = null; //innateStatusesEditor.Statuses = job.PermanentStatus; //statusImmunityEditor.Statuses = job.StatusImmunity; //startingStatusesEditor.Statuses = job.StartingStatus; innateStatusesEditor.SetStatuses(job.PermanentStatus, context); statusImmunityEditor.SetStatuses(job.StatusImmunity, context); startingStatusesEditor.SetStatuses(job.StartingStatus, context); pnl_FormationSprites.Visible = (job.Value < 0x4A); ignoreChanges = false; absorbElementsEditor.ResumeLayout(); cancelElementsEditor.ResumeLayout(); halfElementsEditor.ResumeLayout(); weakElementsEditor.ResumeLayout(); equipmentEditor.ResumeLayout(); innateStatusesEditor.ResumeLayout(); statusImmunityEditor.ResumeLayout(); startingStatusesEditor.ResumeLayout(); this.ResumeLayout(); }
void Awake() { skillset = GameObject.Find("Canvas").GetComponent<SkillSet> (); }