39 lines
1.0 KiB
C#
39 lines
1.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace CS_Projekt_Sem2
|
|
{
|
|
public class Attribute
|
|
{
|
|
//Name des Attributs
|
|
public string AttributeName { get; }
|
|
//Konstruktor, in dem man den Namen übergeben muss
|
|
public Attribute(string name)
|
|
{
|
|
this.AttributeName = name;
|
|
}
|
|
//Aktuelles Level des Attributs
|
|
private int _level = 0;
|
|
//Öffentliche Sichtbarkeit des Levels
|
|
public int Level { get { return _level; } }
|
|
//Kosten für eine Erhöhung des Levels
|
|
public int CostsNextLevel { get { return (int)((_level == 0 ? 1 : _level + 1) * 1.1); } }
|
|
//Versuch, ein Level zu erhöhen
|
|
public bool PutNextLevel(int aviablePoints)
|
|
{
|
|
if (aviablePoints >= CostsNextLevel)
|
|
{
|
|
_level++;
|
|
return true;
|
|
}
|
|
else
|
|
return false;
|
|
}
|
|
|
|
|
|
}
|
|
}
|