Пример #1
0
 // Create a copy from this resource
 public Resource(Resource resource)
     : base(resource.sprite)
 {
     Colour = resource.Colour;
     scale = resource.scale;
     IsCarried = resource.IsCarried;
     islandType = resource.islandType;
 }
Пример #2
0
        public Island(Texture2D sprite, Colour colour, IslandType type, Resource resource, Texture2D[] tokens)
            : base(sprite)
        {
            Colour = colour;
            scale = new Vector2(0.3f);
            ResourceType = resource;
            Type = type;

            redToken = new Token(tokens[0]);
            blueToken = new Token(tokens[1]);
            yellowToken = new Token(tokens[2]);
            greenToken = new Token(tokens[3]);

            AddResource(resource);
        }
Пример #3
0
 public void AddResource(Resource r)
 {
     switch (r.Colour)
     {
         case(Colour.Red):
             hasRed = true;
             break;
         case (Colour.Blue):
             hasBlue = true;
             break;
         case (Colour.Yellow):
             hasYellow = true;
             break;
         case (Colour.Green):
             hasGreen = true;
             break;
     }
 }