Advertisement
OwlyOwl

classHPMP

Apr 5th, 2020
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.75 KB | None | 0 0
  1. using System;
  2.  
  3. namespace OOP
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             Mage fireMage = new Mage(120, 250, 60, 2);
  10.  
  11.             fireMage.ShowStats();
  12.         }
  13.     }
  14.     class Mage
  15.     {
  16.         public int Health;
  17.         public int Mana;
  18.         public int Damage;
  19.         public int CastTime;
  20.  
  21.         public Mage(int health, int mana, int damage, int castTime)
  22.         {
  23.             Health = health;
  24.             Mana = mana;
  25.             Damage = damage;
  26.             CastTime = castTime;
  27.         }
  28.  
  29.         public void ShowStats()
  30.         {
  31.             Console.WriteLine("HP - " + Health + "\nMP - " + Mana + "\nDMG - " + Damage + "\nCast Time - " + CastTime + " sec");
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement