//Static methods to create a GameMaterial from a specific data. static GameMaterial ReadData(MaterialData data) { return(new GameMaterial() { id = data.Id, name = data.Name, sprite = SpritePool.LoadSprite(data.SpriteId), color = new Color(data.R, data.G, data.B, data.A) }); }
//Static Methods to create a Worker from a specific data. static Worker ReadData(WorkerData data) { return(new Worker() { id = data.Id, name = data.Name, sprite = SpritePool.LoadSprite(data.SpriteId), color = new Color(data.R, data.G, data.B, data.A), tired = data.Tired, talent = data.Talent, motivation = data.Motivation }); }
//Static Methods to create a Worker from a specific data. public static Piece ReadData(PieceData data) { return(new Piece() { id = data.Id, name = data.Name, onlyColor = data.IsOnlyColor, sprite = SpritePool.LoadSprite(data.SpriteId), color = new Color(data.R, data.G, data.G, data.A), materialsNeeded = StringToRequirements(data.Requirements), secondsNeeded = data.SecondsNeeded, quantityToCreate = data.QuantityToCreate }); }