Advertisement
shadowplaycoding

P030_Planet

Jul 20th, 2018
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.94 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class Planet {
  5.  
  6.     public string planetName { get; set; }
  7.     public string planetType { get; set; }
  8.  
  9.     public Resources planetResources;
  10.  
  11.     public StarBase starBase;
  12.  
  13.     public bool planetColonised = false;
  14.  
  15.     public float production = 2;
  16.  
  17.     public Planet(string name, string type)
  18.     {
  19.         this.planetName = name;
  20.         this.planetType = type;
  21.  
  22.         this.planetResources = RandomiseResources();
  23.  
  24.         this.starBase = null;
  25.     }
  26.  
  27.     Resources RandomiseResources()
  28.     {
  29.         int food = Random.Range(0, 3);
  30.         int minerals = Random.Range(0, 3);
  31.         int credits = Random.Range(0, 3);
  32.  
  33.         Resources resources = new Resources(credits, minerals, food);
  34.  
  35.         return resources;
  36.     }
  37.  
  38.  
  39.  
  40.  
  41.  
  42.     /*
  43.    Copyright Shadowplay Coding 2017 - see www.shadowplaycoding.com for licensing details
  44.    Removing this comment forfits any rights given to the user under licensing.
  45.    */
  46.  
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement