Skip to content

Instantly share code, notes, and snippets.

@Velsimir
Last active September 10, 2023 11:59
Show Gist options
  • Save Velsimir/8c3cc4eed330c08e3fd557f1a145ad17 to your computer and use it in GitHub Desktop.
Save Velsimir/8c3cc4eed330c08e3fd557f1a145ad17 to your computer and use it in GitHub Desktop.
class Player
{
readonly Weapon _weapon;
readonly Movement _movement;
public Player(string name, int age)
{
Name = name;
Age = age;
_weapon = new Weapon();
_movement = new Movement();
}
public string Name { get; private set; }
public int Age { get; private set; }
public void Attack()
{
//attack
}
}
class Weapon
{
public float Cooldown { get; private set; }
public int Damage { get; private set; }
public bool IsReloading => throw new NotImplementedException();
}
class Movement
{
public float Speed { get; private set; }
public float DirectionX { get; private set; }
public float DirectionY { get; private set; }
public void Move()
{
//Do move
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment