55 lines
1.9 KiB
C#
55 lines
1.9 KiB
C#
using System.Collections.Immutable;
|
|
using RobotAndDonkey.Game.Cards;
|
|
using RobotAndDonkey.Game.Data;
|
|
using RobotAndDonkey.Game.GameState;
|
|
using RobotAndDonkey.Game.Modifiers;
|
|
|
|
namespace RobotAndDonkey.Game.Robots;
|
|
|
|
public abstract record Robot(ERobotType Type, ImmutableArray<ECard> Deck, int ProgramCount) : Entity
|
|
{
|
|
protected static Currency CreateCurrency(MatchParameters parameters)
|
|
{
|
|
var energy = parameters.Difficulty switch
|
|
{
|
|
EDifficulty.Easy => Balancing.Instance.RobotEasyEnergy,
|
|
EDifficulty.Medium => Balancing.Instance.RobotMediumEnergy,
|
|
_ => Balancing.Instance.RobotHardEnergy
|
|
};
|
|
var maxCarry = parameters.Difficulty switch
|
|
{
|
|
EDifficulty.Easy => Balancing.Instance.EasyMaxCarry,
|
|
EDifficulty.Medium => Balancing.Instance.MediumMaxCarry,
|
|
_ => Balancing.Instance.HardMaxCarry
|
|
};
|
|
var handSize = parameters.Difficulty switch
|
|
{
|
|
EDifficulty.Easy => Balancing.Instance.EasyHandSize,
|
|
EDifficulty.Medium => Balancing.Instance.MediumHandSize,
|
|
_ => Balancing.Instance.HardHandSize
|
|
};
|
|
var tapeLength = parameters.Difficulty switch
|
|
{
|
|
EDifficulty.Easy => Balancing.Instance.EasyTapeLength,
|
|
EDifficulty.Medium => Balancing.Instance.MediumTapeLength,
|
|
_ => Balancing.Instance.HardTapeLength
|
|
};
|
|
return new(energy, maxCarry, 0, 0, tapeLength, handSize);
|
|
}
|
|
|
|
public Robot DeepClone()
|
|
{
|
|
var result = CreateInstance();
|
|
result.Currency = Currency;
|
|
return result;
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return $"{Type}" + base.ToString();
|
|
}
|
|
|
|
protected abstract Robot CreateInstance();
|
|
|
|
public Currency Currency;
|
|
} |