This commit is contained in:
2022-04-24 09:05:15 +04:00
commit b26e7c1402
60 changed files with 3887 additions and 0 deletions
+46
View File
@@ -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
{
}
+17
View File
@@ -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();
}
}
}
+27
View File
@@ -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");
}
}
}