示例#1
0
 //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)
     });
 }
示例#2
0
 //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
     });
 }
示例#3
0
 //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
     });
 }