[Fix] Number of towers in sectors
This commit is contained in:
parent
edfa773579
commit
79a2f22ef0
|
@ -13,21 +13,21 @@ namespace LyokoCMD.Sim
|
|||
// Lyoko
|
||||
VirtualWorld lyoko = new VirtualWorldBuilder("Lyoko")
|
||||
.AddSector("Territoire Montagne", "Territoire Désert", "Territoire Forêt", "Territoire Banquise")
|
||||
.AddTowers(9)
|
||||
.AddTowers(20)
|
||||
.AddWayTowers()
|
||||
.AddSector("5ème territoire", true, 1)
|
||||
.Build();
|
||||
sc.Workers.Add(lyoko);
|
||||
Objects.Register(lyoko, "Lyoko");
|
||||
// Lyokoguerriers
|
||||
Objects.Register(new Human("Aelita", true), "Aelita");
|
||||
Objects.Register(new Human("Odd"), "Odd");
|
||||
Objects.Register(new Human("Ulrich"), "Ulrich");
|
||||
Objects.Register(new Human("Yumi"), "Yumi");
|
||||
// Objects.Register(new Human("Aelita", true), "Aelita");
|
||||
// Objects.Register(new Human("Odd"), "Odd");
|
||||
// Objects.Register(new Human("Ulrich"), "Ulrich");
|
||||
// Objects.Register(new Human("Yumi"), "Yumi");
|
||||
// Véhicules
|
||||
Objects.Register(new Vehicle("Overboard"), "Overboard");
|
||||
Objects.Register(new Vehicle("Overbike"), "Overbike");
|
||||
Objects.Register(new Vehicle("Overwing"), "Overwing");
|
||||
// Objects.Register(new Vehicle("Overboard"), "Overboard");
|
||||
// Objects.Register(new Vehicle("Overbike"), "Overbike");
|
||||
// Objects.Register(new Vehicle("Overwing"), "Overwing");
|
||||
// Virtualisation
|
||||
sc.Tasks.Add(new VirtualizationTask());
|
||||
// Retour vers le passé
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace LyokoCMD.Game
|
||||
{
|
||||
/// <summary>
|
||||
/// Décrit un territoire de Lyoko.
|
||||
/// </summary>
|
||||
public class Heart
|
||||
{
|
||||
private int _life = 100;
|
||||
public int Life
|
||||
{
|
||||
get => _life;
|
||||
set
|
||||
{
|
||||
if (_life > 1 && _life - value < 1)
|
||||
{
|
||||
_life = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
_life -= value;
|
||||
}
|
||||
}
|
||||
}
|
||||
public DateTime LastHurt;
|
||||
public List<Sector> Sectors = new List<Sector>();
|
||||
|
||||
public HeartStatus Status
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Life <= 0)
|
||||
{
|
||||
return HeartStatus.DEAD;
|
||||
}
|
||||
|
||||
if (Life == 1)
|
||||
{
|
||||
return HeartStatus.OPEN;
|
||||
}
|
||||
|
||||
if (Life <= 15)
|
||||
{
|
||||
return HeartStatus.FIRST_SHIELD;
|
||||
}
|
||||
|
||||
if (Life <= 50)
|
||||
{
|
||||
return HeartStatus.SECOND_SHIELD;
|
||||
}
|
||||
|
||||
return HeartStatus.THIRD_SHIELD;
|
||||
}
|
||||
}
|
||||
|
||||
private VirtualWorld _virtualWorld;
|
||||
|
||||
public Heart(VirtualWorld virtualWorld)
|
||||
{
|
||||
_virtualWorld = virtualWorld;
|
||||
}
|
||||
}
|
||||
|
||||
public enum HeartStatus
|
||||
{
|
||||
DEAD,
|
||||
OPEN,
|
||||
FIRST_SHIELD,
|
||||
SECOND_SHIELD,
|
||||
THIRD_SHIELD
|
||||
}
|
||||
}
|
Reference in New Issue