コード例 #1
0
ファイル: Hero.cs プロジェクト: moto2002/BoEG
        public override void SetData(IEntityData data)
        {
            _data = (HeroData)data;
            base.SetData(data);
            if (data == null)
            {
                return;
            }

            gameObject.name = _data.Name + " (Hero)";

            var mr = gameObject.GetComponentInChildren <MeshRenderer>();

            if (mr != null)
            {
                mr.material = _data.Mat;
            }

            _abilitiable = new Abilitiable(gameObject, _data);
            _armorable   = new Armorable(_data);

            _attackable   = new Attackable(gameObject);
            _attackerable = new Attackerable(gameObject, _data);

            _healthable = new Healthable(gameObject, _data);

            _magicable = new Magicable(gameObject, _data);
            _movable   = new Movable(gameObject, _data);
            _events    = new MiscEvent();

            _jobSystem = new JobSystem(gameObject);

            _teamable = new Teamable(gameObject);
        }
コード例 #2
0
ファイル: DBCommands.cs プロジェクト: onixion/MAD
        public DBMemoShow(object[] args)
        {
            _js = (JobSystem)args[0];
            _db = (DB)args[1];

            rPar.Add(new ParOption("id", "NODE-ID", "ID of the node.", false, false, new Type[] { typeof(int) }));
        }
コード例 #3
0
ファイル: JobSystemCommands.cs プロジェクト: onixion/MAD
 public JobSystemAddCheckFtpCommand(object[] args)
     : base()
 {
     _js = (JobSystem)args[0];
     rPar.Add(new ParOption("u", "USERNAME", "Username on the server.", false, false, new Type[] { typeof(string) }));
     rPar.Add(new ParOption("p", "PASSWORD", "Password on the server.", false, false, new Type[] { typeof(string) }));
 }
コード例 #4
0
        public void delete_job_from_job_system()
        {
            TestJob job = new TestJob(Vector2Int.zero, null);

            _jobFinished          = false;
            job.JobResultHandler += OnJobFinish;
            JobSystem.GetInstance().AddJob(job);
            job.DeleteJob();

            //test removal from job system lists
            if (JobSystem.GetInstance().AllJobs.Contains(job) == true)
            {
                Assert.Fail();
            }

            //test that job result handler did invoke
            if (JobSystem.GetInstance().AvailableJobs.Contains(job) == true)
            {
                Assert.Fail();
            }

            //test that job finished with flag wasJobCanceled
            if (_wasJobCanceled == false || _jobFinished == false)
            {
                Assert.Fail();
            }

            Assert.Pass();
        }
コード例 #5
0
ファイル: JobSystemCommands.cs プロジェクト: onixion/MAD
 public JobSystemAddHostDetectCommand(object[] args)
     : base()
 {
     _js = (JobSystem)args[0];
     rPar.Add(new ParOption("m", "SUBNETMASK", "Subnetmask of the target Net", false, false, new Type[] { typeof(IPAddress) }));
     description = "Checks the given Network for all IPAddresses. Mind that it won't work if Ping is blocked.";
 }
コード例 #6
0
    private void CheckCurrentTileContents()
    {
        Tile currentTile = Utils.TileAt(Position.x, Position.y);

        //Removing any existing stockpiles from the tile
        StockpileCreator.RemoveStockpileFromTile(currentTile);

        //there must be no other items or vegetation on the tile
        if (currentTile.Contents.HasItem)
        {
            RemoveItemFromTileUnderConstructionPlan();
            return;
        }

        if (currentTile.Contents.StaticObject is ICuttable vegetation)
        {
            Job job = new CutJob(vegetation, Position);
            job.JobResultHandler += OnTileClearJobFinish;
            _jobs.Add(job);
            JobSystem.GetInstance().AddJob(job);
            return;
        }

        foreach (var ingredient in Ingredients)
        {
            for (int i = ingredient.count; i > 0; i--)
            {
                CreateHaulingJobForIngredient(SearchEngine.GetTypeDerivativeOf <Item>(ingredient.itemName));
            }
        }
    }
コード例 #7
0
ファイル: JobSystemCommands.cs プロジェクト: onixion/MAD
 public JobSystemSaveNodeCommand(object[] args)
 {
     _js = (JobSystem)args[0];
     rPar.Add(new ParOption("file", "FILENAME", "Name of the file to load node from.", false, false, new Type[] { typeof(string) }));
     rPar.Add(new ParOption("id", "NODE-ID", "ID of the node which should be saved.", false, false, new Type[] { typeof(int) }));
     description = "This command save a node.";
 }
コード例 #8
0
ファイル: Get_Job.aspx.cs プロジェクト: zhenghua75/kmdx_web
    public void BinData()
    {
        JobSystem jobSystem = new JobSystem();

        Job_List.DataSource = jobSystem.Get_Job(AspNetPager1.StartRecordIndex, AspNetPager1.EndRecordIndex);
        Job_List.DataBind();
    }
コード例 #9
0
ファイル: JobSystemCommands.cs プロジェクト: onixion/MAD
 public JobSystemAddPortCommand(object[] args)
     : base()
 {
     _js = (JobSystem)args[0];
     rPar.Add(new ParOption("p", "PORT", "Port of the target.", false, false, new Type[] { typeof(int) }));
     oPar.Add(new ParOption("tout", "TIMEOUT", "Timeout of the ping.", false, false, new Type[] { typeof(int) }));
     description = "This command adds a job with the jobtype 'PortScan' to the node with the given ID.";
 }
コード例 #10
0
ファイル: Get_Job.aspx.cs プロジェクト: zhenghua75/kmdx_web
    protected void Job_List_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        int       nID       = Int32.Parse(Job_List.DataKeys[e.RowIndex].Value.ToString());
        JobSystem jobSystem = new JobSystem();

        jobSystem.Delete_Job(nID);
        BinData();
    }
コード例 #11
0
    private void CreateHaulingJobForIngredient(Type ingredientType)
    {
        HaulToItemHolderJob job = new HaulToItemHolderJob(ingredientType, this);

        JobSystem.GetInstance().AddJob(job);
        _jobs.Add(job);
        job.JobResultHandler += HandleHaulJobResult;
    }
コード例 #12
0
ファイル: JobSystemCommands.cs プロジェクト: onixion/MAD
        public JobSystemStatusJobsCommand(object[] args)
            : base()
        {
            _js = (JobSystem)args[0];

            oPar.Add(new ParOption("more", "", "Show more infos.", true, false, null));
            description = "This command prints a table with all initialized jobs.";
        }
コード例 #13
0
ファイル: DBCommands.cs プロジェクト: onixion/MAD
        public DBMemoAdd(object[] args)
        {
            _js = (JobSystem)args[0];
            _db = (DB)args[1];

            rPar.Add(new ParOption("id", "NODE-ID", "ID of the node.", false, false, new Type[] { typeof(int) }));
            rPar.Add(new ParOption("m1", "MEMO1", "First memo to attach to node.", false, true, new Type[] { typeof(string) }));
            rPar.Add(new ParOption("m2", "MEMO2", "Second memo to attach to node.", false, true, new Type[] { typeof(string) }));
        }
コード例 #14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Title = "科技有限公司";
     if (!Page.IsPostBack)
     {
         JobSystem jobSystem = new JobSystem();
         AspNetPager1.RecordCount = jobSystem.Get_JobNum();
     }
 }
コード例 #15
0
ファイル: MainWindow.cs プロジェクト: onixion/MAD
        public static void InitGUI(JobSystem jobSys, DB database, DHCPReader dhcp)
        {
            _js   = jobSys;
            _db   = database;
            _dhcp = dhcp;

            cli        = new CLI(_js, _dhcp, _db);
            _CLITHREAD = new Thread(new ThreadStart(cli.Start));
        }
コード例 #16
0
ファイル: CLISession.cs プロジェクト: onixion/MAD
 public CLISession(NetworkStream stream, AES aes, JobSystem js, DHCPReader dhcpReader, DB db)
     : base()
 {
     _stream     = stream;
     _aes        = aes;
     _js         = js;
     _dhcpReader = dhcpReader;
     _db         = db;
 }
コード例 #17
0
ファイル: JobSystemCommands.cs プロジェクト: onixion/MAD
 public JobSystemAddCheckSnmpCommand(object[] args)
     : base()
 {
     _js = (JobSystem)args[0];
     rPar.Add(new ParOption("ver", "VERSION", "Version of SNMP to use.", false, false, new Type[] { typeof(uint) }));
     oPar.Add(new ParOption("l", "SECURITY-LEVEL", "Level of used security", false, false, new Type[] { typeof(string) }));
     oPar.Add(new ParOption("a", "AUTH-PROTOCOL", "Protocol for authentification", false, false, new Type[] { typeof(string) }));
     oPar.Add(new ParOption("p", "PRIV-PROTCOL", "Protocol for privacy", false, false, new Type[] { typeof(string) }));
 }
コード例 #18
0
ファイル: JobSystemCommands.cs プロジェクト: onixion/MAD
 public JobSystemAddNodeCommand(object[] args)
 {
     _js = (JobSystem)args[0];
     rPar.Add(new ParOption("n", "NODE-NAME", "Name of the node.", false, false, new Type[] { typeof(string) }));
     rPar.Add(new ParOption("mac", "MAC-ADDRESS", "MAC-Address of the target.", false, false, new Type[] { typeof(PhysicalAddress) }));
     rPar.Add(new ParOption("ip", "IP-ADDRESS", "IP-Address of the target.", false, false, new Type[] { typeof(IPAddress) }));
     oPar.Add(new ParOption("i", "IP-RENEW", "Try to renew IP-Addresses over ARP-Request.", true, false, null));
     description = "This command creates a node.";
 }
コード例 #19
0
ファイル: JobSystemCommands.cs プロジェクト: onixion/MAD
        public JobSystemAddPingCommand(object[] args)
            : base()
        {
            _js = (JobSystem)args[0];

            oPar.Add(new ParOption("ttl", "TTL", "TTL of the ping.", false, false, new Type[] { typeof(int) }));
            oPar.Add(new ParOption("tout", "TIMEOUT", "Timeout of the ping.", false, false, new Type[] { typeof(int) }));
            description = "This command adds a job with the jobtype 'PingRequest' to the node with the given ID.";
        }
コード例 #20
0
ファイル: WorldGenerator.cs プロジェクト: harald921/Absent
    void Start()
    {
        _camTransform = Camera.main.transform;

        _parameters = GetComponent <Noise>().parameters;

        _chunkGenerator = new ChunkGenerator(_parameters);

        JobSystem.Initialize();
    }
コード例 #21
0
ファイル: ARPReader.cs プロジェクト: onixion/MAD
 private static void SteadyStartsFunktion(object jsArg)
 {
     while (true)
     {
         JobSystem _js = (JobSystem)jsArg;
         FloodStart();
         _js.SyncNodes(ModelHost.hostList);
         Thread.Sleep(3000);
     }
 }
コード例 #22
0
ファイル: JobSystemCommands.cs プロジェクト: onixion/MAD
        public JobSystemEditJobCommand(object[] args)
        {
            _js = (JobSystem)args[0];

            rPar.Add(new ParOption("id", "JOB-ID", "ID of the job to edit.", false, false, new Type[] { typeof(Int32) }));
            oPar.Add(new ParOption("n", "JOB-NAME", "Name of the job.", false, false, new Type[] { typeof(string) }));
            oPar.Add(new ParOption("t", "TIME", "Delaytime or time on which th job should be executed.", false, true, new Type[] { typeof(Int32), typeof(string) }));
            oPar.Add(new ParOption("rule", "NOT.-RULE", "Define Rule(s).", false, true, new Type[] { typeof(string) }));
            oPar.Add(new ParOption("ne", "", "Enables notification over E-Mail.", true, false, null));
        }
コード例 #23
0
ファイル: CLIServer.cs プロジェクト: onixion/MAD
        public CLIServer(JobSystem js, DHCPReader dhcpReader, DB db)
        {
            _serverHeader = MadConf.conf.SERVER_HEADER;
            serverPort    = MadConf.conf.SERVER_PORT;

            _js         = js;
            _dhcpReader = dhcpReader;
            _db         = db;

            _aes = new AES(MadConf.conf.AES_PASS);
        }
コード例 #24
0
ファイル: SnmpCommands.cs プロジェクト: onixion/MAD
        public JobSystemAddReadTrafficCommand(object[] args)
            : base()
        {
            _js = (JobSystem)args[0];

            rPar.Add(new ParOption(JobAddCommand.JOB_NAME, "JOB-NAME", "Name of the job.", false, false, new Type[] { typeof(string) }));
            rPar.Add(new ParOption(JobAddCommand.JOB_ID, "NODE-ID", "ID of the node to add the job to.", false, false, new Type[] { typeof(int) }));
            oPar.Add(new ParOption(JobAddCommand.JOB_TIME_PAR, "TIME", "Delaytime or time on which th job should be executed.", false, true, new Type[] { typeof(Int32), typeof(string) }));
            oPar.Add(new ParOption("i", "INTERFACE", "Interface which should be read", false, false, new Type[] { typeof(uint) }));
            description = "This Command will try to read the outgoing traffic out of a host. Don't forget to set the credentials to public, MADMADMAD and MADMADMAD again. \n Also if it doesn't work, you may check the interface in the config file and compare it to the snmpinterface command";
        }
コード例 #25
0
    public void BinData()
    {
        Job       job       = new Job();
        JobSystem jobSystem = new JobSystem();

        job           = jobSystem.Get_SingJob(nID);
        Title.Text    = job.Title;
        ID.Value      = job.ID.ToString();
        Content.Value = job.Content;
        Click.Text    = job.Click.ToString();
    }
コード例 #26
0
    public void Visualize(Vector2 position, Color color, float delay)
    {
        icon.color = color;
        rectTransform.localPosition = position;
        JobAction jobAction = (float timeStamp, bool isComplete) =>
        {
            isVisualize = true;
        };

        JobSystem.ScheduleUntil(jobAction, delay);
    }
コード例 #27
0
    protected void Update_Btn_Click(object sender, EventArgs e)
    {
        Job job = new Job();

        job.ID      = Int32.Parse(ID.Value.ToString());
        job.Title   = Title.Text.ToString();
        job.Content = Content.Value.ToString();
        job.Click   = Int32.Parse(Click.Text.ToString());
        JobSystem jobSystem = new JobSystem();

        jobSystem.Update_Job(job);
        Response.Write("<script>alert('修改成功');location.href='Get_Job.aspx';</script>");
    }
コード例 #28
0
ファイル: Get_Job.aspx.cs プロジェクト: zhenghua75/kmdx_web
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["Admin_User"] == null)
     {
         Response.Redirect("login.aspx");
         Response.End();
     }
     else
     {
         JobSystem jobSystem = new JobSystem();
         AspNetPager1.RecordCount = jobSystem.Get_JobNum();
     }
 }
コード例 #29
0
    private void CreateJobs()
    {
        Dictionary <Tree, GameObject> temp = new Dictionary <Tree, GameObject>(_trees);

        foreach (KeyValuePair <Tree, GameObject> pair in temp)
        {
            if (pair.Key.HasCutJob == false)
            {
                JobSystem.GetInstance().AddJob(new CutJob(pair.Key, pair.Key.Position, pair.Value));
                _trees.Remove(pair.Key);
            }
        }
    }
コード例 #30
0
    public override bool CheckInitialization()
    {
        if (_worker is null)
        {
            return(false);
        }

        if (JobSystem.GetInstance().HasWorker(this) == false)
        {
            return(false);
        }

        return(true);
    }