Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System;
- public enum TowerType
- {
- tA,
- tB,
- tC
- };
- public class Tower {
- private TowerType type;
- private int damage;
- private int range;
- private int health;
- public Tower(TowerType type)
- {
- this.type = type;
- initializeVariables();
- }
- private void initializeVariables()
- {
- if (this.type != null)
- {
- if (this.type == TowerType.tA)
- {
- this.damage = 20;
- this.range = 40;
- this.health = 50;
- }
- else if (this.type == TowerType.tB)
- {
- this.damage = 30;
- this.range = 50;
- this.health = 60;
- }
- else if (this.type == TowerType.tC)
- {
- this.damage = 60;
- this.range = 60;
- this.health = 80;
- }
- }
- }
- public int getDamage()
- {
- return this.damage;
- }
- public int getRange()
- {
- return this.range;
- }
- public int getHealth()
- {
- return this.health;
- }
- public TowerType getTowerType()
- {
- return this.type;
- }
- public string getType(int value)
- {
- return Enum.GetName(typeof(TowerType), value);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement