initial
This commit is contained in:
Executable
+46
@@ -0,0 +1,46 @@
|
||||
using NLog;
|
||||
using Ragon.Core;
|
||||
|
||||
namespace Game.Source
|
||||
{
|
||||
public class ArenaPlugin: PluginBase
|
||||
{
|
||||
private ILogger _logger = LogManager.GetCurrentClassLogger();
|
||||
|
||||
public override void OnStart()
|
||||
{
|
||||
// _logger.Info("Plugin started");
|
||||
}
|
||||
|
||||
public override void OnStop()
|
||||
{
|
||||
// _logger.Info("Plugin stopped");
|
||||
}
|
||||
|
||||
public long FindPrimeNumber(int n)
|
||||
{
|
||||
int count=0;
|
||||
long a = 2;
|
||||
while(count<n)
|
||||
{
|
||||
long b = 2;
|
||||
int prime = 1;// to check if found a prime
|
||||
while(b * b <= a)
|
||||
{
|
||||
if(a % b == 0)
|
||||
{
|
||||
prime = 0;
|
||||
break;
|
||||
}
|
||||
b++;
|
||||
}
|
||||
if(prime > 0)
|
||||
{
|
||||
count++;
|
||||
}
|
||||
a++;
|
||||
}
|
||||
return (--a);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace Game.Source.Events;
|
||||
|
||||
public class SpawnEvent
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using Ragon.Core;
|
||||
|
||||
namespace Game.Source
|
||||
{
|
||||
public class GameFactory : PluginFactory
|
||||
{
|
||||
public PluginBase CreatePlugin(string map)
|
||||
{
|
||||
// if (map == "spawn")
|
||||
// return new SpawnPlugin();
|
||||
//
|
||||
// if (map == "arena")
|
||||
// return new ArenaPlugin();
|
||||
return new SpawnPlugin();
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+27
@@ -0,0 +1,27 @@
|
||||
using Game.Source.Events;
|
||||
using NLog;
|
||||
using Ragon.Core;
|
||||
|
||||
namespace Game.Source
|
||||
{
|
||||
public class SpawnPlugin: PluginBase
|
||||
{
|
||||
private ILogger _logger = LogManager.GetCurrentClassLogger();
|
||||
|
||||
public void SpawnEvent(SpawnEvent evnt)
|
||||
{
|
||||
|
||||
}
|
||||
public override void OnStart()
|
||||
{
|
||||
Subscribe<SpawnEvent>(SpawnEvent);
|
||||
|
||||
_logger.Info("Plugin started");
|
||||
}
|
||||
|
||||
public override void OnStop()
|
||||
{
|
||||
_logger.Info("Plugin stopped");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user