Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace OOP
- {
- class Program
- {
- static void Main(string[] args)
- {
- Player player = new Player(10, 2, 5);
- player.ShowStats();
- }
- }
- class Player
- {
- private int _health;
- private int _damage;
- private int _lvl;
- public Player(int health, int damage, int lvl)
- {
- _health = health;
- _damage = damage;
- _lvl = lvl;
- }
- public void ShowStats()
- {
- Console.WriteLine($"HP: {_health}, DMG: {_damage}, LVL: {_lvl}");
- }
- }
- }
Add Comment
Please, Sign In to add comment