Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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) }));
        }
Ejemplo n.º 3
0
 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) }));
 }
Ejemplo n.º 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();
        }
Ejemplo n.º 5
0
 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.";
 }
Ejemplo n.º 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));
            }
        }
    }
Ejemplo n.º 7
0
 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.";
 }
Ejemplo n.º 8
0
    public void BinData()
    {
        JobSystem jobSystem = new JobSystem();

        Job_List.DataSource = jobSystem.Get_Job(AspNetPager1.StartRecordIndex, AspNetPager1.EndRecordIndex);
        Job_List.DataBind();
    }
Ejemplo n.º 9
0
 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.";
 }
Ejemplo n.º 10
0
    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();
    }
Ejemplo n.º 11
0
    private void CreateHaulingJobForIngredient(Type ingredientType)
    {
        HaulToItemHolderJob job = new HaulToItemHolderJob(ingredientType, this);

        JobSystem.GetInstance().AddJob(job);
        _jobs.Add(job);
        job.JobResultHandler += HandleHaulJobResult;
    }
Ejemplo n.º 12
0
        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.";
        }
Ejemplo n.º 13
0
        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) }));
        }
Ejemplo n.º 14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Title = "科技有限公司";
     if (!Page.IsPostBack)
     {
         JobSystem jobSystem = new JobSystem();
         AspNetPager1.RecordCount = jobSystem.Get_JobNum();
     }
 }
Ejemplo n.º 15
0
        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));
        }
Ejemplo n.º 16
0
 public CLISession(NetworkStream stream, AES aes, JobSystem js, DHCPReader dhcpReader, DB db)
     : base()
 {
     _stream     = stream;
     _aes        = aes;
     _js         = js;
     _dhcpReader = dhcpReader;
     _db         = db;
 }
Ejemplo n.º 17
0
 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) }));
 }
Ejemplo n.º 18
0
 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.";
 }
Ejemplo n.º 19
0
        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.";
        }
Ejemplo n.º 20
0
    void Start()
    {
        _camTransform = Camera.main.transform;

        _parameters = GetComponent <Noise>().parameters;

        _chunkGenerator = new ChunkGenerator(_parameters);

        JobSystem.Initialize();
    }
Ejemplo n.º 21
0
 private static void SteadyStartsFunktion(object jsArg)
 {
     while (true)
     {
         JobSystem _js = (JobSystem)jsArg;
         FloodStart();
         _js.SyncNodes(ModelHost.hostList);
         Thread.Sleep(3000);
     }
 }
Ejemplo n.º 22
0
        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));
        }
Ejemplo n.º 23
0
        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);
        }
Ejemplo n.º 24
0
        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";
        }
Ejemplo n.º 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();
    }
Ejemplo n.º 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);
    }
Ejemplo n.º 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>");
    }
Ejemplo n.º 28
0
 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();
     }
 }
Ejemplo n.º 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);
            }
        }
    }
Ejemplo n.º 30
0
    public override bool CheckInitialization()
    {
        if (_worker is null)
        {
            return(false);
        }

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

        return(true);
    }