public static Entity CreateScientist(EntityManager entityManager, Entity faction) { //all this stuff needs a proper bit of code to get names from a file or something. CommanderNameSD name; name.First = "Augusta"; name.Last = "King"; name.IsFemale = true; CommanderTypes type = CommanderTypes.Civilian; //this is going to have to be thought out properly. Dictionary <ResearchCategories, float> bonuses = new Dictionary <ResearchCategories, float>(); bonuses.Add(ResearchCategories.PowerAndPropulsion, 1.1f); byte maxLabs = 25; //create the blob. CommanderDB scientist = new CommanderDB(name, 1, type); ScientistDB bonus = new ScientistDB(bonuses, maxLabs); List <BaseDataBlob> blobs = new List <BaseDataBlob>(); blobs.Add(scientist); blobs.Add(bonus); Entity officer = new Entity(entityManager, blobs); return(officer); }
public ScientistDB(ScientistDB dB) { Bonuses = new Dictionary <ResearchCategories, float>(dB.Bonuses); MaxLabs = dB.MaxLabs; AssignedLabs = dB.AssignedLabs; ProjectQueue = dB.ProjectQueue; }
/// <summary> /// assigns more labs to a given scientist /// will not assign more than scientists MaxLabs /// </summary> /// <param name="scientist"></param> /// <param name="labs"></param> public static void AssignLabs(Entity scientist, byte labs) { //TODO: ensure that the labs are availible to assign. ScientistDB scientistDB = scientist.GetDataBlob <ScientistDB>(); scientistDB.AssignedLabs = Math.Max(scientistDB.MaxLabs, labs); }
/// <summary> /// adds a tech to a scientists research queue. /// </summary> /// <param name="scientist"></param> /// <param name="techID"></param> public static void AssignProject(Entity scientist, Guid techID) { //TODO: check valid research, scientist etc for the empire. ScientistDB scientistDB = scientist.GetDataBlob <ScientistDB>(); //TechSD project = _game.StaticData.Techs[techID]; scientistDB.ProjectQueue.Add(techID); }