예제 #1
0
        public Battle(IEnumerable<IEnumerable<Character>> teams, IPlugin interopPlugin, IJSScriptHelper scriptHelper, IRandomHelper randomHelper)
        {
            if(teams == null)
            {
                throw new ArgumentNullException(nameof(teams));
            }

            if(interopPlugin == null)
            {
                throw new ArgumentNullException(nameof(interopPlugin));
            }

            if(scriptHelper == null)
            {
                throw new ArgumentNullException(nameof(scriptHelper));
            }

            if(randomHelper == null)
            {
                throw new ArgumentNullException(nameof(randomHelper));
            }

            this.AllCharactersInTeams = new Dictionary<string, ICollection<SpecificCharacter>>();

            foreach (var team in teams)
            {
                var teamCharacters = (ICollection<SpecificCharacter>)team.Select(x => new SpecificCharacter(x));
                this.AllCharactersInTeams.Add("team", teamCharacters);
            }

            this.InteropPlugin = interopPlugin;
            this.ScriptHelper = scriptHelper;
            this.RandomHelper = randomHelper;
        }
예제 #2
0
 public void TestSetup()
 {
     container = new UnityContainer();
     InteropPlugins.Bootstrapper.BootstrapUnity(container);
     scriptHelper = container.Resolve<IJSScriptHelper>();
     scriptHelper.ScriptDir = "/TestScripts/";
 }
예제 #3
0
 public JSPlugin(IJSScriptHelper scriptHelper)
 {
     ScriptHelper = scriptHelper;
 }
예제 #4
0
 public void TestSetup()
 {
     container = new UnityContainer();
     Common.Bootstrapper.BootstrapUnity(container);
     InteropPlugins.Bootstrapper.BootstrapUnity(container);
     scriptHelper = container.Resolve<IJSScriptHelper>();
     randomHelper = container.Resolve<IRandomHelper>();
     scriptHelper.ScriptDir = "/TestScripts/";
     pluginInterop = new JSPlugin(scriptHelper);
 }