DNA GenerateRandomDNA() { DNA res = new DNA(); res.level = 1; res.weights = new float[brain[0].neurons.Length * brain[1].neurons.Length]; for (int i = 0; i < res.weights.Length; i++) { res.weights[i] = GenerateRandomWeight(); } //res.fitness = -99999; res.fitness = 0; //memberCounter++; res.memberNum = ++memberCounter; res.name = NameBank.GetRandomName(); res.nameGen = 1; res.bloodlineLevel = 1; res.avatarColor = new Color(Random.Range(0.0f, 1.0f), Random.Range(0.0f, 1.0f), Random.Range(0.0f, 1.0f)); //res.avatarColor = new Color(Random.Range(0.0f, 255.0f), Random.Range(0.0f, 255.0f), Random.Range(0.0f, 255.0f)); //Debug.Log("memberCounter = " + memberCounter.ToString()); //Add entry to bloodlines array. Bloodline newBloodline = new Bloodline(); newBloodline.name = res.name; newBloodline.count = 1; bloodlines.Add(newBloodline); return(res); }
/// <summary> /// Updates the bloodline controls. /// </summary> private void UpdateBloodlineControl() { int index = 0; switch (BlankCharacterUIHelper.Race) { case Race.Amarr: lblAncestry1.Font = lblAncestry2.Font = lblAncestry3.Font = m_amarrFont; break; case Race.Caldari: index = 3; lblAncestry1.Font = lblAncestry2.Font = lblAncestry3.Font = m_caldariFont; break; case Race.Gallente: index = 6; lblAncestry1.Font = lblAncestry2.Font = lblAncestry3.Font = m_gallenteFont; break; case Race.Minmatar: index = 9; lblAncestry1.Font = lblAncestry2.Font = lblAncestry3.Font = m_minmatarFont; break; default: throw new NotImplementedException(); } // Calculate bloodlines based on image position (they used to match up in code, // but the codes were remapped to match the SDE) Bloodline bloodline1 = BLOODLINES_BY_INDEX[index], bloodline2 = BLOODLINES_BY_INDEX[index + 1], bloodline3 = BLOODLINES_BY_INDEX[index + 2]; pbBloodline1.Image = ilBloodline.Images[index]; pbBloodline2.Image = ilBloodline.Images[index + 1]; pbBloodline3.Image = ilBloodline.Images[index + 2]; pbBloodline1.Tag = bloodline1; pbBloodline2.Tag = bloodline2; pbBloodline3.Tag = bloodline3; if (rbBloodline1.Checked) { BlankCharacterUIHelper.Bloodline = bloodline1; } if (rbBloodline2.Checked) { BlankCharacterUIHelper.Bloodline = bloodline2; } if (rbBloodline3.Checked) { BlankCharacterUIHelper.Bloodline = bloodline3; } UpdateAncestryControl(); }
public PersonSelector(Family siblings) { InitializeComponent(); data = SedgeTreeMemoryCardEmulation.GetInstance().GetData(); foreach (Person member in siblings) { comboBox1.Items.Add(member); comboBox1.SelectedItem = member; } }
public PersonSelector(Gender g) { InitializeComponent(); data = SedgeTreeMemoryCardEmulation.GetInstance().GetData(); foreach (Person member in data) { if (member.gender == g) { comboBox1.Items.Add(member); comboBox1.SelectedItem = member; } } }
public void WillChooseAKnowledgeSkillIfOptionsAreAvailable() { var character = CharacterTestTemplates.AverageBob().WithSkills(new string[] { "Knowledge Dungeoneering", "Knowledge Arcana" }); var bloodline = Bloodline.CreateWithValues("Special", new string[] { "Knowledge Arcana", "Knowledge Dungeoneering" }, new Dictionary <int, string>(), new Dictionary <int, string>(), new string[] { }); character.Add(bloodline); Assert.True(character.SkillRanks.GetSkill("Knowledge Arcana").ClassSkill || character.SkillRanks.GetSkill("Knowledge Dungeoneering").ClassSkill); }
/// <summary> /// Updates the bloodline controls. /// </summary> private void UpdateBloodlineControl() { int index = 0; switch (m_race) { default: case Race.Amarr: lblAncestry1.Font = lblAncestry2.Font = lblAncestry3.Font = m_AmarrFont; break; case Race.Caldari: index = 3; lblAncestry1.Font = lblAncestry2.Font = lblAncestry3.Font = m_CaldariFont; break; case Race.Gallente: index = 6; lblAncestry1.Font = lblAncestry2.Font = lblAncestry3.Font = m_GallenteFont; break; case Race.Minmatar: index = 9; lblAncestry1.Font = lblAncestry2.Font = lblAncestry3.Font = m_MinmatarFont; break; } pbBloodline1.Image = ilBloodline.Images[index]; pbBloodline2.Image = ilBloodline.Images[index + 1]; pbBloodline3.Image = ilBloodline.Images[index + 2]; pbBloodline1.Tag = (Bloodline)Enum.ToObject(typeof(Bloodline), index); pbBloodline2.Tag = (Bloodline)Enum.ToObject(typeof(Bloodline), index + 1); pbBloodline3.Tag = (Bloodline)Enum.ToObject(typeof(Bloodline), index + 2); if (rbBloodline1.Checked) { m_bloodline = (Bloodline)pbBloodline1.Tag; } if (rbBloodline2.Checked) { m_bloodline = (Bloodline)pbBloodline2.Tag; } if (rbBloodline3.Checked) { m_bloodline = (Bloodline)pbBloodline3.Tag; } UpdateAncestryControl(); }
private void personLöschenToolStripMenuItem_Click(object sender, EventArgs e) { Bloodline data = memoryCard.GetData(); Person target = PersonSelector.DoSelection(this); if (MessageBox.Show(this, "Soll " + target.FullName + " gelöscht werden?", "", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2, 0) != System.Windows.Forms.DialogResult.Yes) { return; } data.Remove(target); int a = 0; foreach (Person quake in data) { if (quake.children != null) { if (quake.children.Contains(target)) { quake.children.Remove(target); a++; } } if (quake.father == target) { quake.father = null; a++; } if (quake.marriage == target) { quake.marriage = null; a++; } if (quake.mother == target) { quake.mother = null; a++; } if (quake.siblings != null) { if (quake.siblings.Contains(target)) { quake.siblings.Remove(target); a++; } } } MessageBox.Show(target.FullName + " wurde gelöscht.\n" + a.ToString() + " Bezüge wurden entfernt."); speichernToolStripMenuItem.Enabled = true; }
// GET: Bloodline/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(NotFound()); } Bloodline Bloodline = DAL.GetBloodline((int)id); if (Bloodline == null) { return(NotFound()); } return(View(Bloodline)); }
public Ancestry(int ancestryId, string name, Bloodline bloodline, string description, int perception, int willpower, int charisma, int memory, int intelligence, int graphicId, string shortDescription) { mAncestryID = ancestryId; mName = name; mBloodline = bloodline; mDescription = description; mPerception = perception; mWillpower = willpower; mCharisma = charisma; mMemory = memory; mIntelligence = intelligence; mGraphicID = graphicId; mShortDescription = shortDescription; }
public ActionResult Create([Bind("Description,Name,ID")] Bloodline Bloodline) { if (ModelState.IsValid) { if (DAL.CreateBloodline(Bloodline) > 0) { //success } else { //error } return(RedirectToAction(nameof(Index))); } return(View(Bloodline)); }
public Dictionary <int, Bloodline> GetBloodlineInformation() { Dictionary <int, Bloodline> result = new Dictionary <int, Bloodline>(); MySqlConnection connection = null; MySqlDataReader reader = Database.Query( ref connection, "SELECT " + " bloodlineTypes.bloodlineID, typeID, bloodlineName, raceID, description, maleDescription, " + " femaleDescription, shipTypeID, corporationID, perception, willpower, charisma, memory, " + " intelligence, graphicID, shortDescription, shortMaleDescription, shortFemaleDescription " + " FROM bloodlineTypes, chrBloodlines " + " WHERE chrBloodlines.bloodlineID = bloodlineTypes.bloodlineID" ); using (connection) using (reader) { while (reader.Read() == true) { Bloodline bloodline = new Bloodline( reader.GetInt32(0), this.TypeManager[reader.GetInt32(1)], reader.GetString(2), reader.GetInt32(3), reader.GetString(4), reader.GetString(5), reader.GetString(6), this.TypeManager[reader.GetInt32(7)], reader.GetInt32(8), reader.GetInt32(9), reader.GetInt32(10), reader.GetInt32(11), reader.GetInt32(12), reader.GetInt32(13), reader.GetInt32OrDefault(14), reader.GetString(15), reader.GetString(16), reader.GetString(17) ); result[bloodline.ID] = bloodline; } } return(result); }
int GetNextNameGen(string bloodlineName) { int res = 1; for (int i = 0; i < bloodlines.Count; i++) { if (bloodlines[i].name == bloodlineName) { Bloodline tmp = bloodlines[i]; res = ++tmp.count; bloodlines[i] = tmp; break; } } return(res); }
public Editor(Person _t) { data = SedgeTreeMemoryCardEmulation.GetInstance().GetData(); AzusaContext context = AzusaContext.GetInstance(); target = _t; InitializeComponent(); UpdateView(_t); byte[] buffer = context.DatabaseDriver.SedgeTree_GetPhotoByPerson(_t); if (buffer != null) { pictureBox1.Image = Image.FromStream(new System.IO.MemoryStream(buffer)); } button2.Enabled = data.ContainsFemales; button3.Enabled = data.ConatinsMales; }
public void AddsAFeatTokenFromTheListOfOptions() { var adder = new AddBloodlineBonusFeat(); var sorcerer = CharacterTestTemplates.Sorcerer().WithSkills(); var bloodline = Bloodline.CreateWithValues( "arcane", new string[] { "perception" }, new Dictionary <int, string>(), new Dictionary <int, string>(), new string[] { "Improved Initiative" } ); sorcerer.Add(bloodline); adder.ExecuteStep(sorcerer); var featToken = sorcerer.Get <FeatToken>(); Assert.NotNull(featToken); Assert.Contains("Improved Initiative", featToken.Tags); }
private void LoadData() { context.Splash.SetLabel("Frage Stammbaumversion ab..."); Nullable <int> version = context.DatabaseDriver.SedgeTree_GetLatestVersion(); if (version == null) { context.Splash.SetLabel("Lade Stammbaumdaten..."); byte[] rawDdata = context.DatabaseDriver.SedgeTree_GetDataByVersion(version.Value); MemoryStream memoryStream = new MemoryStream(rawDdata, false); BinaryFormatter bf = new BinaryFormatter(); data = (Bloodline)bf.Deserialize(memoryStream); memoryStream.Close(); } else { data = new Bloodline(); } }
public void BonusSpellsAreAddedToTheAppropriateSpellLevel() { var sorcerer = CharacterTestTemplates.Sorcerer() .WithSkills(new string[] { "perception" }) .WithSpontaneousCasting(); var bloodline = Bloodline.CreateWithValues( "aberrant", new string[] { "perception" }, new Dictionary <int, string>(), new Dictionary <int, string> { { 1, "some random spell" } }, new string[] { }); sorcerer.Add(bloodline); var casting = sorcerer.Get <SpontaneousCasting>(); var addSpells = new AddBloodlineBonusSpell(new MemoryStore("spell-level", "1")); addSpells.ExecuteStep(sorcerer); AssertExtensions.Contains("some random spell", casting.GetReadySpells(1)); }
public ActionResult Edit(int id, [Bind("Description,Name,ID")] Bloodline Bloodline) { if (id != Bloodline.ID) { return(NotFound()); } if (ModelState.IsValid) { if (DAL.UpdateBloodline(Bloodline, id) > 0) { //success } else { //error } return(RedirectToAction(nameof(Index))); } return(View(Bloodline)); }
/// <summary> /// Creates the character. /// </summary> /// <returns></returns> private static SerializableCCPCharacter CreateCharacter() { SerializableCCPCharacter serial = new SerializableCCPCharacter { ID = UriCharacter.BlankCharacterID, Name = CharacterName, Birthday = DateTime.UtcNow, Race = Race.ToString(), BloodLine = Bloodline.ToString().Replace("_", "-"), Ancestry = Ancestry.ToString().Replace("_", " "), Gender = Gender.ToString(), CorporationName = "Blank Character's Corp", CorporationID = 9999999, Balance = 0, Attributes = new SerializableCharacterAttributes { Intelligence = EveConstants.CharacterBaseAttributePoints + 3, Memory = EveConstants.CharacterBaseAttributePoints + 3, Perception = EveConstants.CharacterBaseAttributePoints + 3, Willpower = EveConstants.CharacterBaseAttributePoints + 3, Charisma = EveConstants.CharacterBaseAttributePoints + 2 }, ImplantSets = new SerializableImplantSetCollection { ActiveClone = new SerializableSettingsImplantSet { Name = "Active Clone" }, }, }; serial.Skills.AddRange(GetSkillsForRace()); return(serial); }
public void AddsAPowerThatIsAvailableAtCurrentLevel() { var bloodline = Bloodline.CreateWithValues( "draconic", new string [] { "perception" }, new Dictionary <int, string>() { { 3, "SilverNeedle.Characters.Attacks.AcidicRay" } }, new Dictionary <int, string>(), new string[] { } ); var character = CharacterTestTemplates.Sorcerer().WithSkills(); character.Add(bloodline); var addPower = new AddBloodlinePower(); character.SetLevel(3); addPower.ExecuteStep(character); Assert.NotNull(character.Get <AcidicRay>()); }
private void FormatInput() { int Pos = Patron.IndexOf(PathfinderConstants.PAREN_LEFT); if (Pos > 0) { Patron = Patron.Substring(0, Pos - 1).Trim(); } Bloodline = Bloodline.Replace("*", string.Empty); Bloodline = Bloodline.Replace("-", PathfinderConstants.SPACE); ClassList = Utility.RemoveSuperScripts(ClassList); Domians = Utility.RemoveSuperScripts(Domians); Mysteries = Utility.RemoveSuperScripts(Mysteries); Bloodline = Utility.RemoveSuperScripts(Bloodline); Patron = Utility.RemoveSuperScripts(Patron); if (Bloodline.Length > 0) { Bloodline = Bloodline.ProperCase(); Bloodline = Bloodline.Replace(PathfinderConstants.SPACE, string.Empty); } if (Mysteries.Length > 0) { Mysteries = Mysteries.ProperCase(); Mysteries = Mysteries.Replace(PathfinderConstants.SPACE, string.Empty); Mysteries = Mysteries.Replace("*", string.Empty); Pos = Mysteries.IndexOf(PathfinderConstants.PAREN_LEFT); if (Pos > 0) { Mysteries = Mysteries.Substring(0, Pos).Trim(); } } }
private void baumansichtToolStripMenuItem_Click(object sender, EventArgs e) { Bloodline data = memoryCard.GetData(); if (data.Count == 0) { return; } Person target = null; int branches = 0; foreach (Person p in data) { if (p.Generations > branches) { target = p; branches = p.Generations; } } TreeDisplay ed = new TreeDisplay(target); ed.Show(); }
bool LoadGameData() { GameData data = SaveSystem.LoadPopulation(); if (data == null) { return(false); } initialPopulationSize = data.initialPopulationSize; generation = data.curGeneration; scoreManager.globalHighScore = data.globalHighScore; memberCounter = data.memberCounter; int popCount = population.Count; /*memberNum = new int[popCount]; * weights = new float[popCount, playerController.population[0].weights.Length]; * fitness = new float[popCount]; * ratio = new float[popCount]; * evaluated = new bool[popCount]; * generation = new int[popCount]; * level = new int[popCount];*/ bloodlines = new List <Bloodline>(); for (int i = 0; i < data.bloodlineNames.Length; i++) { Bloodline tmp = new Bloodline(); tmp.name = data.bloodlineNames[i]; tmp.count = data.bloodlineCounts[i]; //bloodlineCounts[i] = playerController.bloodlines[i].count; bloodlines.Add(tmp); } population = new List <DNA>(); for (int i = 0; i < data.memberNum.Length; i++) { DNA loadedMember = new DNA(); loadedMember.memberNum = data.memberNum[i]; loadedMember.weights = new float[data.weights.GetLength(1)]; for (int j = 0; j < data.weights.GetLength(1); j++) { loadedMember.weights[j] = data.weights[i, j]; } loadedMember.fitness = data.fitness[i]; loadedMember.ratio = data.ratio[i]; loadedMember.evaluated = data.evaluated[i]; loadedMember.generation = data.generation[i]; loadedMember.level = data.level[i]; loadedMember.name = data.name[i]; loadedMember.nameGen = data.nameGen[i]; loadedMember.bloodlineLevel = data.bloodlineLevel[i]; loadedMember.avatarColor = new Color(data.avatarColor[i, 0], data.avatarColor[i, 1], data.avatarColor[i, 2]); population.Add(loadedMember); } return(true); }
public BannedBloodline(Ancestry ancestry, Bloodline bloodline) : base("BannedBloodline", new PyDictionary { ["name"] = ancestry.Name, ["bloodlineName"] = bloodline.Name }) { }
/// <summary> /// Updates the bloodline controls. /// </summary> private void UpdateBloodlineControl() { int index = 0; switch (m_race) { default: case Race.Amarr: lblAncestry1.Font = lblAncestry2.Font = lblAncestry3.Font = m_AmarrFont; break; case Race.Caldari: index = 3; lblAncestry1.Font = lblAncestry2.Font = lblAncestry3.Font = m_CaldariFont; break; case Race.Gallente: index = 6; lblAncestry1.Font = lblAncestry2.Font = lblAncestry3.Font = m_GallenteFont; break; case Race.Minmatar: index = 9; lblAncestry1.Font = lblAncestry2.Font = lblAncestry3.Font = m_MinmatarFont; break; } pbBloodline1.Image = ilBloodline.Images[index]; pbBloodline2.Image = ilBloodline.Images[index + 1]; pbBloodline3.Image = ilBloodline.Images[index + 2]; pbBloodline1.Tag = (Bloodline)Enum.ToObject(typeof(Bloodline), index); pbBloodline2.Tag = (Bloodline)Enum.ToObject(typeof(Bloodline), index + 1); pbBloodline3.Tag = (Bloodline)Enum.ToObject(typeof(Bloodline), index + 2); if (rbBloodline1.Checked) m_bloodline = (Bloodline)pbBloodline1.Tag; if (rbBloodline2.Checked) m_bloodline = (Bloodline)pbBloodline2.Tag; if (rbBloodline3.Checked) m_bloodline = (Bloodline)pbBloodline3.Tag; UpdateAncestryControl(); }
/// <summary> /// Handles the Click event of the rbBloodline3 control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void rbBloodline3_Click(object sender, EventArgs e) { m_bloodline = (Bloodline)pbBloodline3.Tag; UpdateAncestryControl(); }
/// <summary> /// Updates the bloodline controls. /// </summary> private void UpdateBloodlineControl() { int index = 0; Bloodline[] tags; switch (BlankCharacterUIHelper.Race) { case Race.Amarr: lblAncestry1.Font = lblAncestry2.Font = lblAncestry3.Font = m_amarrFont; tags = new Bloodline[] { Bloodline.Amarr, Bloodline.Ni_Kunni, Bloodline.Khanid }; break; case Race.Caldari: index = 3; lblAncestry1.Font = lblAncestry2.Font = lblAncestry3.Font = m_caldariFont; tags = new Bloodline[] { Bloodline.Deteis, Bloodline.Civire, Bloodline.Achura }; break; case Race.Gallente: index = 6; tags = new Bloodline[] { Bloodline.Gallente, Bloodline.Intaki, Bloodline.Jin_Mei }; break; case Race.Minmatar: index = 9; lblAncestry1.Font = lblAncestry2.Font = lblAncestry3.Font = m_minmatarFont; tags = new Bloodline[] { Bloodline.Sebiestor, Bloodline.Brutor, Bloodline.Vherokior }; break; default: throw new NotImplementedException(); } pbBloodline1.Image = ilBloodline.Images[index]; pbBloodline2.Image = ilBloodline.Images[index + 1]; pbBloodline3.Image = ilBloodline.Images[index + 2]; pbBloodline1.Tag = tags[0]; pbBloodline2.Tag = tags[1]; pbBloodline3.Tag = tags[2]; if (rbBloodline1.Checked) { BlankCharacterUIHelper.Bloodline = tags[0]; } if (rbBloodline2.Checked) { BlankCharacterUIHelper.Bloodline = tags[1]; } if (rbBloodline3.Checked) { BlankCharacterUIHelper.Bloodline = tags[2]; } UpdateAncestryControl(); }
public Checker() { InitializeComponent(); context = AzusaContext.GetInstance(); this.Text = "Konsistenzprüfung " + DateTime.Now; int cons = 0; Bloodline data = SedgeTreeMemoryCardEmulation.GetInstance().GetData(); foreach (Person p in data) { if (!p.consistent) { if (p.birthplace == "") { AddEntry(p.FullName + " hat keinen Geburtsort!"); } if (p.born == DateTime.MinValue) { AddEntry(p.FullName + " hat kein Geburtsdatum!"); } else { DateTime maximumTheoreticalAge = DateTime.Now; if (p.died != DateTime.MinValue) { maximumTheoreticalAge = p.died; } TimeSpan age_check = maximumTheoreticalAge - p.born; int year = age_check.Days / 365; if (year > 100) { AddEntry(p.FullName + " ist anscheinend " + year.ToString() + " Jahre alt. Stimmt das?"); } } if (p.father == null) { AddEntry(p.FullName + " hat keinen Vater!"); } if (p.forename == "") { AddEntry(p.FullName + " hat keinen Vornamen!"); } if (p.gender == Gender.DontCare) { AddEntry(p.FullName + " hat kein Geschlecht!"); } if (p.mother == null) { AddEntry(p.FullName + " hat keine Mutter!"); } if (p.surname == "") { AddEntry(p.FullName + " hat keinen Nachnamen!"); } if (!CheckPhoto(p)) { AddEntry(p.FullName + " hat kein Foto!"); } cons++; } } if (cons == data.Count) { AddEntry("Es existiert kein konsistenter Datensatz!"); } Person target = null; int branches = 0; foreach (Person p in data) { if (p.Generations > branches) { target = p; branches = p.Generations; } } if (branches < 3) { AddEntry("Es gibt weniger als drei bekannte Generationen."); } }
public PyDataType CreateCharacter2( PyString characterName, PyInteger bloodlineID, PyInteger genderID, PyInteger ancestryID, PyDictionary appearance, CallInformation call) { int validationError = this.ValidateNameEx(characterName, call); // ensure the name is valid switch (validationError) { case (int)NameValidationResults.TooLong: throw new CharNameInvalidMaxLength(); case (int)NameValidationResults.Taken: throw new CharNameInvalidTaken(); case (int)NameValidationResults.IllegalCharacters: throw new CharNameInvalidSomeChar(); case (int)NameValidationResults.TooShort: throw new CharNameInvalidMinLength(); case (int)NameValidationResults.MoreThanOneSpace: throw new CharNameInvalidMaxSpaces(); case (int)NameValidationResults.Banned: throw new CharNameInvalidBannedWord(); case (int)NameValidationResults.Valid: break; // unknown actual error, return generic error default: throw new CharNameInvalid(); } // load bloodline and ancestry info for the requested character Bloodline bloodline = this.mBloodlineCache[bloodlineID]; Ancestry ancestry = this.mAncestriesCache[ancestryID]; long currentTime = DateTime.UtcNow.ToFileTimeUtc(); if (ancestry.Bloodline != bloodline) { Log.Error($"The ancestry {ancestryID} doesn't belong to the given bloodline {bloodlineID}"); throw new BannedBloodline(ancestry, bloodline); } Character character = this.CreateCharacter(characterName, ancestry, genderID, appearance, currentTime, call); Station station = this.ItemManager.GetStation(character.StationID); // change character attributes based on the picked ancestry character.Charisma = bloodline.Charisma + ancestry.Charisma; character.Intelligence = bloodline.Intelligence + ancestry.Intelligence; character.Memory = bloodline.Memory + ancestry.Memory; character.Willpower = bloodline.Willpower + ancestry.Willpower; character.Perception = bloodline.Perception + ancestry.Perception; // get skills by race and create them Dictionary <int, int> skills = this.DB.GetBasicSkillsByRace(bloodline.RaceID); foreach (KeyValuePair <int, int> pair in skills) { ItemType skillType = this.TypeManager[pair.Key]; // create the skill at the required level this.ItemManager.CreateSkill(skillType, character, pair.Value); } // create the ship for the character Ship ship = this.ItemManager.CreateShip(bloodline.ShipType, station, character); // add one unit of Tritanium to the station's hangar for the player ItemType tritaniumType = this.TypeManager[ItemTypes.Tritanium]; ItemEntity tritanium = this.ItemManager.CreateSimpleItem(tritaniumType, character, station, ItemFlags.Hangar); // add one unit of Damage Control I to the station's hangar for the player ItemType damageControlType = this.TypeManager[ItemTypes.DamageControlI]; ItemEntity damageControl = this.ItemManager.CreateSimpleItem(damageControlType, character, station, ItemFlags.Hangar); // create an alpha clone ItemType cloneType = this.TypeManager[ItemTypes.CloneGradeAlpha]; Clone clone = this.ItemManager.CreateClone(cloneType, station, character); character.LocationID = ship.ID; character.ActiveClone = clone; // character is 100% created and the base items are too // persist objects to database and unload them as they do not really belong to us clone.Persist(); damageControl.Persist(); tritanium.Persist(); ship.Persist(); character.Persist(); // join the character to all the general channels this.ChatDB.GrantAccessToStandardChannels(character.ID); // create required mailing list channel this.ChatDB.CreateChannel(character, character, characterName, true); // and subscribe the character to some channels this.ChatDB.JoinEntityMailingList(character.ID, character.ID); this.ChatDB.JoinEntityChannel(character.SolarSystemID, character.ID); this.ChatDB.JoinEntityChannel(character.ConstellationID, character.ID); this.ChatDB.JoinEntityChannel(character.RegionID, character.ID); this.ChatDB.JoinEntityChannel(character.CorporationID, character.ID); this.ChatDB.JoinEntityMailingList(character.CorporationID, character.ID); // unload items from list this.ItemManager.UnloadItem(clone); this.ItemManager.UnloadItem(damageControl); this.ItemManager.UnloadItem(tritanium); this.ItemManager.UnloadItem(ship); this.ItemManager.UnloadItem(character); // finally return the new character's ID and wait for the subsequent calls from the EVE client :) return(character.ID); }
public BloodlineTests() { var configuration = bloodlineYaml.ParseYaml(); aberrant = new Bloodline(configuration); }