A lot of fixes
This commit is contained in:
parent
1f89c1762b
commit
4e6f064b1d
|
@ -24,7 +24,9 @@ namespace LyokoCMD.CommandLine
|
|||
new SupercomputerCommand(),
|
||||
new TaskCommand(),
|
||||
new ServiceCommand(),
|
||||
new VirtualizationCommand()
|
||||
new VirtualizationCommand(),
|
||||
new TimeWarpCommand(),
|
||||
new VirtualWorldCommand()
|
||||
);
|
||||
app.AppStartup += new System.EventHandler(app_AppStartup);
|
||||
app.AppStop += new System.EventHandler(app_AppStop);
|
||||
|
|
|
@ -2,20 +2,20 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using LyokoCMD.Commands;
|
||||
using DasConzoleCore;
|
||||
using DasConzoleCore.Commands;
|
||||
using LyokoCMD.Sim;
|
||||
|
||||
namespace LyokoCMD.Game
|
||||
namespace LyokoCMD.Sim.Commands
|
||||
{
|
||||
class TimeWarpCommand : Command
|
||||
public class TimeWarpCommand : Command
|
||||
{
|
||||
public override string[] Aliases => new string[] { "timewarp" };
|
||||
public override string[] Names => new string[] { "timewarp" };
|
||||
public override string Description => "Lance un retour vers le passé.";
|
||||
public override string Author => "Valentin";
|
||||
public override Version Version => new Version(1, 0);
|
||||
public override string HelpText => "Alias pour la tâche de retour vers le passé du supercalculateur.\nUsage: timewarp [hours] [delay_seconds]";
|
||||
public override void Run(Engine e, string[] args)
|
||||
public override void Run(CommandApp app, string[] args)
|
||||
{
|
||||
Supercomputer sc = e.Game.Objects.Get<Supercomputer>();
|
||||
Supercomputer sc = Game.Objects.Get<Supercomputer>();
|
||||
if (!sc.Running) throw new InvalidOperationException("Impossible de se connecter au supercalculateur.");
|
||||
if (args.Length < 1) throw new ArgumentException(HelpText);
|
||||
if (args.Length < 2)
|
||||
|
|
|
@ -1,32 +1,31 @@
|
|||
using System;
|
||||
using LyokoCMD.Commands;
|
||||
using LyokoCMD.Game.Workers;
|
||||
using LyokoCMD.UI;
|
||||
using DasConzoleCore;
|
||||
using DasConzoleCore.UI;
|
||||
using DasConzoleCore.Commands;
|
||||
using LyokoCMD.Sim.Workers;
|
||||
using LyokoCMD.Sim.Virtual;
|
||||
using LyokoCMD.Sim.Virtual.World;
|
||||
|
||||
namespace LyokoCMD.Game
|
||||
namespace LyokoCMD.Sim.Commands
|
||||
{
|
||||
class VirtualWorldCommand : Command
|
||||
public class VirtualWorldCommand : Command
|
||||
{
|
||||
public override string[] Aliases => new string[] { "vw" };
|
||||
public override string[] Names => new string[] { "vw" };
|
||||
|
||||
public override string Description => "Permet d'éxecuter des fonctions sur le monde virtuel.";
|
||||
|
||||
public override string HelpText => "Usage : vw [command]\n\tshow [sector]\tAffiche le territoire passé en paramètre.";
|
||||
|
||||
public override string Author => "Valentin";
|
||||
|
||||
public override Version Version => new Version(1, 0);
|
||||
|
||||
public override void Run(Engine e, string[] args)
|
||||
public override void Run(CommandApp app, string[] args)
|
||||
{
|
||||
Supercomputer sc = e.Game.Objects.Get<Supercomputer>();
|
||||
Supercomputer sc = Game.Objects.Get<Supercomputer>();
|
||||
if (!sc.Running) throw new InvalidOperationException("Impossible de se connecter au supercalculateur.");
|
||||
if (!sc.GetWorker("lyoko").Running) throw new InvalidOperationException("Monde virtuel arrêté.");
|
||||
if (args.Length < 1) throw new ArgumentException(HelpText);
|
||||
if (args[0] == "show")
|
||||
{
|
||||
if (args.Length < 2) throw new ArgumentException(HelpText);
|
||||
ShowSector(e.Game.Objects.Get<VirtualWorld>().Sectors.Find(s => s.ShortName == args[1]));
|
||||
ShowSector(Game.Objects.Get<VirtualWorld>().Sectors.Find(s => s.ShortName == args[1]));
|
||||
}
|
||||
throw new ArgumentException(HelpText);
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ using System.Text;
|
|||
using DasConzoleCore;
|
||||
using DasConzoleCore.UI;
|
||||
using DasConzoleCore.Commands;
|
||||
using LyokoCMD.Sim.Virtual;
|
||||
|
||||
namespace LyokoCMD.Sim.Commands
|
||||
{
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
using System;
|
||||
|
||||
namespace LyokoCMD.Game
|
||||
namespace LyokoCMD.Sim
|
||||
{
|
||||
public class NoMoreEnergyException : Exception
|
||||
{
|
||||
public NoMoreEnergyException() : base("Le supercalcaluteur n'a plus d'energie pour fonctionner")
|
||||
public NoMoreEnergyException() : base("Le supercalculateur n'a plus d'énergie pour fonctionner")
|
||||
{
|
||||
}
|
||||
|
||||
public NoMoreEnergyException(string what) : base("Le supercalcaluteur n'a plus d'energie pour " + what)
|
||||
public NoMoreEnergyException(string what) : base("Le supercalculateur n'a plus d'énergie pour " + what)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
using DasConzoleCore;
|
||||
using LyokoCMD.Sim.VirtualWorld;
|
||||
using LyokoCMD.Sim.VirtualWorld.World;
|
||||
using LyokoCMD.Sim.VirtualWorld.Tower;
|
||||
using LyokoCMD.Sim.Virtual;
|
||||
using LyokoCMD.Sim.Virtual.World;
|
||||
using LyokoCMD.Sim.Virtual.Towers;
|
||||
using LyokoCMD.Sim.Tasks;
|
||||
using LyokoCMD.Sim.Workers;
|
||||
|
||||
|
@ -45,7 +45,7 @@ namespace LyokoCMD.Sim
|
|||
Objects.Register(tw);
|
||||
sc.Tasks.Add(new TimeWarpTask());
|
||||
Objects.Register(sc);
|
||||
sc.Workers.Add(new TimeWarpWorker(this));
|
||||
sc.Workers.Add(new TimeWarpWorker());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using LyokoCMD.Sim.VirtualWorld;
|
||||
using LyokoCMD.Sim.Virtual;
|
||||
|
||||
namespace LyokoCMD.Sim
|
||||
{
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using LyokoCMD.Sim.Workers;
|
||||
using LyokoCMD.Sim.Tasks;
|
||||
|
||||
namespace LyokoCMD.Sim
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using LyokoCMD.Game.Workers;
|
||||
using LyokoCMD.Sim.Workers;
|
||||
|
||||
namespace LyokoCMD.Sim.Tasks
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace LyokoCMD.Sim.VirtualWorld
|
||||
namespace LyokoCMD.Sim.Virtual
|
||||
{
|
||||
public class Coordinates : Tuple<double, double>
|
||||
{
|
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace LyokoCMD.Sim.VirtualWorld.Tower
|
||||
namespace LyokoCMD.Sim.Virtual.Towers
|
||||
{
|
||||
public class Tower : Virtualizable
|
||||
{
|
|
@ -2,9 +2,9 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using LyokoCMD.Sim.VirtualWorld.World;
|
||||
using LyokoCMD.Sim.Virtual.World;
|
||||
|
||||
namespace LyokoCMD.Sim.VirtualWorld.Tower
|
||||
namespace LyokoCMD.Sim.Virtual.Towers
|
||||
{
|
||||
/// <summary>
|
||||
/// Décrit une tour de passage.
|
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace LyokoCMD.Sim.VirtualWorld
|
||||
namespace LyokoCMD.Sim.Virtual
|
||||
{
|
||||
/// <summary>
|
||||
/// Spécifie qu'un objet peut être virtualisable sur Lyoko par l'opérateur du supercalculateur.
|
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace LyokoCMD.Sim.VirtualWorld
|
||||
namespace LyokoCMD.Sim.Virtual
|
||||
{
|
||||
class Vehicle : Virtualizable
|
||||
{
|
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace LyokoCMD.Sim.VirtualWorld
|
||||
namespace LyokoCMD.Sim.Virtual
|
||||
{
|
||||
/// <summary>
|
||||
/// Spécifie qu'un objet peut être virtualisable sur Lyoko.
|
|
@ -1,7 +1,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace LyokoCMD.Sim.VirtualWorld.World
|
||||
namespace LyokoCMD.Sim.Virtual.World
|
||||
{
|
||||
/// <summary>
|
||||
/// Décrit un coeur de Lyoko.
|
|
@ -2,8 +2,10 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using LyokoCMD.Sim.Virtual;
|
||||
using LyokoCMD.Sim.Virtual.Towers;
|
||||
|
||||
namespace LyokoCMD.VirtualWorld.World
|
||||
namespace LyokoCMD.Sim.Virtual.World
|
||||
{
|
||||
/// <summary>
|
||||
/// Décrit un territoire de Lyoko.
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
|||
using System.Text;
|
||||
using LyokoCMD.Sim.Workers;
|
||||
|
||||
namespace LyokoCMD.Sim.VirtualWorld.World
|
||||
namespace LyokoCMD.Sim.Virtual.World
|
||||
{
|
||||
/// <summary>
|
||||
/// Décrit le monde virtuel Lyoko.
|
|
@ -2,8 +2,9 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using LyokoCMD.Sim.Virtual.Towers;
|
||||
|
||||
namespace LyokoCMD.Sim.VirtualWorld
|
||||
namespace LyokoCMD.Sim.Virtual.World
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe simplifiant la création d'un monde virtuel.
|
|
@ -1,14 +1,14 @@
|
|||
using System;
|
||||
using System.Threading;
|
||||
using LyokoCMD.Sim.Virtual.World;
|
||||
|
||||
namespace LyokoCMD.Game.Workers
|
||||
namespace LyokoCMD.Sim.Workers
|
||||
{
|
||||
/// <summary>
|
||||
/// Décrit le monde virtuel Lyoko en arrière plan
|
||||
/// </summary>
|
||||
public class TimeWarpWorker : SCWorker
|
||||
{
|
||||
private Game _Game;
|
||||
private long _LastTime;
|
||||
public long Delay
|
||||
{
|
||||
|
@ -22,10 +22,7 @@ namespace LyokoCMD.Game.Workers
|
|||
}
|
||||
}
|
||||
|
||||
public TimeWarpWorker(Game game) : base("TimeWarp")
|
||||
{
|
||||
_Game = game;
|
||||
}
|
||||
public TimeWarpWorker() : base("TimeWarp") { }
|
||||
|
||||
public override double RequiredEnergy => 0.0;
|
||||
|
||||
|
@ -38,8 +35,8 @@ namespace LyokoCMD.Game.Workers
|
|||
{
|
||||
if (Delay <= 0)
|
||||
{
|
||||
_Game.Objects.Get<TimeWarpEnergyProvider>().Warp(_Game);
|
||||
_Game.Objects.Get<VirtualWorld>().MaterializeAll();
|
||||
Game.Objects.Get<TimeWarpEnergyProvider>().Warp();
|
||||
Game.Objects.Get<VirtualWorld>().MaterializeAll();
|
||||
Console.WriteLine("Retour vers le passé enclenché");
|
||||
Stop();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using LyokoCMD.Sim.Virtual.World;
|
||||
|
||||
namespace LyokoCMD.Game.Workers
|
||||
namespace LyokoCMD.Sim.Workers
|
||||
{
|
||||
/// <summary>
|
||||
/// Décrit le monde virtuel Lyoko en arrière plan
|
||||
|
|
Reference in New Issue