Inheritance: Oyun
Exemplo n.º 1
0
 private void ID_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         PS.Focus();
     }
 }
        public void Step()
        {
            if (PS.Set.Count == 0)
            {
                PS = Initialize();
            }

            foreach (Operator o in GA.Operations)
            {
                PS = o.Operate(PS);
                PS = GA.Evaluation.Evaluate(PS);
                PS.Print();
            }

            /*
             *
             * // IQuery query = new SimpleQuery(); Will be implemented properly when the code is merged with the Action/Query group
             * double myAverage = 0; // just a mock cuz of not yet working properties in this project
             * Actualize();
             * //myAverage
             * if (PS.CheckForChange())
             * {
             *  List<String> mockAgentsList = null;
             *  // query.SetNewCondition(new PropertyOp("AverageValue", o => ((double)o > myAverage)));
             *  IAction action = new ActionGet(this, mockAgentsList, 10);
             *  AddAction(action);
             * }
             *
             */
        }
Exemplo n.º 3
0
 public void playHighThrust()
 {
     foreach (ParticleSystem PS in highThrust)
     {
         PS.Play();
     }
 }
Exemplo n.º 4
0
 public override void Stop()
 {
     Logger.Info <PsiManager>($"Ending PsiManager...");
     Dispose();
     Logger.Info <PsiManager>($"PsiManager Ended...");
     PS.Set(ProcessStates.Stopped);
 }
Exemplo n.º 5
0
 public void playMidThrust()
 {
     foreach (ParticleSystem PS in midThrust)
     {
         PS.Play();
     }
 }
Exemplo n.º 6
0
        static void Simple01()
        {
            List <Product>  Lp  = Product.GetSampleProducts();
            List <Supplier> Lsp = Supplier.GetSampleSupplier();

            Lp.Add(new Product("Noname"));

            //Left outer JOIN
            var result = from p in Lp.Where(x => x.Price <= 100 || x?.Price == null)
                         join s in Lsp on p.SupplierID equals s.SupplierID
                         into PS
                         from res in PS.DefaultIfEmpty()
                         select new
            {
                Sname = res?.Name ?? null,
                Pname = p.Name,
                Price = p?.Price ?? null,
            };


            foreach (var v in result.OrderBy(x => x?.Price).ThenBy(x => x?.Sname).ThenBy(x => x.Pname))
            {
                Console.WriteLine("{0} - {1:N2} - {2}", v.Pname, v.Price, v.Sname);
            }

            Console.ReadLine();
        }
Exemplo n.º 7
0
 public void playLowThrust()
 {
     foreach (ParticleSystem PS in lowThrust)
     {
         PS.Play();
     }
 }
Exemplo n.º 8
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.P))
        {
            if ((PS.activeInHierarchy) && (SceneManager.GetActiveScene().name == ("levelOne")))
            {
                PS.SetActive(false);
                paused = false;
                Debug.LogWarning("unpaused");
                Time.timeScale = 1;
            }

            else if ((!PS.activeInHierarchy) && (SceneManager.GetActiveScene().name == ("levelOne")))
            {
                PS.SetActive(true);
                Time.timeScale = 0;
                Debug.LogWarning("paused");
                paused = true;
            }
        }

        if (Input.GetKeyDown(KeyCode.Q))
        {
            if (SceneManager.GetActiveScene().name == ("levelOne"))
            {
                Debug.Log("Quit Game");
            }
        }
    }
 public PointSet Initialize()
 {
     PS = GA.Initialization.Create();
     PS = GA.Evaluation.Evaluate(PS);
     PS.Print();
     return(PS);
 }
Exemplo n.º 10
0
 public void play_button()
 {
     foreach (ParticleSystem PS in ParticleSystems)
     {
         PS.Play();
     }
 }
Exemplo n.º 11
0
        public void FillReferences(IEnumerable <PageListDTO> listT)
        {
            var ids = listT.Select(d => d.Id).ToList();
            var q   = from p in DbContext.PageRoutes
                      where ids.Contains(p.Page.Id)
                      select new
            {
                p.Id,
                Edit    = p.EditUrl != null ? 1 : 0,
                Add     = p.AddUrl != null ? 1 : 0,
                Details = p.DetailsUrl != null ? 1 : 0,
                List    = p.ListUrl != null ? 1 : 0
            };

            var qq = from p in DbContext.PageParameters
                     where ids.Contains(p.Page.Id) && p.LinkedPageId != null
                     group p by p.PageId into PS
                     select new { PS.Key, Count = PS.Count() };
            var routs = q.ToList();
            var par   = qq.ToList();

            foreach (var page in listT)
            {
                var pr = routs.Where(d => d.Id == page.Id).FirstOrDefault();
                var pp = par.Where(d => d.Key == page.Id).FirstOrDefault();
                if (pr != null)
                {
                    page.References = pr.Edit + pr.Add + pr.Details + pr.List;
                }
                if (pp != null)
                {
                    page.References += pp.Count;
                }
            }
        }
Exemplo n.º 12
0
        protected void StopManagers(bool forced = false)
        {
            Logger.Info <SactaProxy>("Deteniendo Gestores.");

            Managers.ForEach(depEntry =>
            {
                if (forced)
                {
                    if (depEntry.IsMain)
                    {
                        (depEntry.Manager as PsiManager).EventActivity    -= OnPsiEventActivity;
                        (depEntry.Manager as PsiManager).EventSectRequest -= OnPsiEventSectorizationAsk;
                    }
                    else
                    {
                        (depEntry.Manager as ScvManager).EventActivity      -= OnScvEventActivity;
                        (depEntry.Manager as ScvManager).EventSectorization -= OnScvEventSectorization;
                    }
                }
                depEntry.Manager.Stop();
            });
            if (forced)
            {
                Managers.Clear();
            }

            PS.Set(ProcessStates.Stopped);
            Logger.Info <SactaProxy>("Gestores Detenidos.");
        }
Exemplo n.º 13
0
 public void Play()
 {
     foreach (ParticleSystem PS in ParticleSystems)
     {
         PS.Play();
     }
 }
Exemplo n.º 14
0
 public override void Stop()
 {
     Logger.Info <ScvManager>($"Ending ScvManager for {Id}...");
     Dispose();
     Logger.Info <ScvManager>($"ScvManager for {Id} Ended...");
     PS.Set(ProcessStates.Stopped);
 }
Exemplo n.º 15
0
    public PS Tongvoi1so(PS t2)
    {
        PS t = new PS();

        t.ts = this.ts * 1 + this.ms * t2.ts;
        t.ms = this.ms * 1;
        return(t.Rutgon());
    }
Exemplo n.º 16
0
    public static PS operator -(PS t1, PS t2)
    {
        PS t = new PS();

        t.ts = t1.ts * t2.ms - t1.ms * t2.ts;
        t.ms = t1.ms * t2.ms;
        return(t.Rutgon());
    }
Exemplo n.º 17
0
    public PS Hieu(PS t2)
    {
        PS t = new PS();

        t.ts = this.ts * t2.ms - this.ms * t2.ts;
        t.ms = this.ms * t2.ms;
        return(t.Rutgon());
    }
Exemplo n.º 18
0
    public PS Tong(PS t2)
    {
        PS t = new PS();

        t.ts = this.ts * t2.ms + this.ms * t2.ts;
        t.ms = this.ms * t2.ms;
        return(t.Rutgon());
    }
Exemplo n.º 19
0
 public MostrarConsolas(List <PS> list)
 {
     InitializeComponent();
     foreach (PS g in list)
     {
         rtbConsolas.Text = PS.MostrarDatosPS(list);
     }
 }
Exemplo n.º 20
0
        public void CrossProduct()
        {
            Vector v = PQ.GetSimplified().GetCrossProduct(PS.GetSimplified());

            Assert.AreEqual(-4, v.GetX());
            Assert.AreEqual(-1, v.GetY());
            Assert.AreEqual(-2, v.GetZ());
        }
Exemplo n.º 21
0
    // Use this for initialization
    void Start()
    {
        PS = GameObject.Find("Canvas_Pause");

        PS.SetActive(false);

        paused = false;
    }
Exemplo n.º 22
0
    public PS Hieuvoi1so(PS t2)
    {
        PS t = new PS();

        t.ts = this.ts * 1 - this.ms * t2.ts;
        t.ms = this.ms * 1;
        return(Rutgon());
    }
Exemplo n.º 23
0
 /// <summary>
 /// Will play the list of particles attached to this object
 /// </summary>
 private void PlayExplosion()
 {
     foreach (var PS in m_Explosion)
     {
         PS.Play();
     }
     FindObjectOfType <FailStateManager>().SwitchGameState(GameState.FAILED);
 }
Exemplo n.º 24
0
 public PR(PS result, string message = null)
 {
     this.Result  = result;
     this.Message = message;
     if (string.IsNullOrEmpty(this.Message))
     {
         this.Message = this.Result.ToDisplayName();
     }
 }
Exemplo n.º 25
0
 public bool HasProperty(PS key)
 {
     CheckProperties();
     if (properties.ContainsKey((byte)key))
     {
         return(true);
     }
     return(false);
 }
Exemplo n.º 26
0
        static void Main(string[] args)
        {
            PS ps1 = new PS(WriteToS);
            PS ps2 = new PS(WriteToF);
            PS ps  = ps1;

            ps += ps2;
            bool success = ps("Hello World");
        }
Exemplo n.º 27
0
    public void Step(int dDays)
    {
        // step for System

        // step for each PS
        foreach (var PS in planetSystems)
        {
            PS.Step(dDays);
        }
    }
Exemplo n.º 28
0
        public PS Get(int id)
        {
            PS ps = new PS()
            {
                Id = 123,
                GUID = "2CB9357D-9056-4A46-BDCA-28745A9C470A",
                MSPProjectURL = "MSPProjectURL",
                Author = "Ivanov",
                Comments = "All ok",
                Version = 1,
                VersionDate = DateTime.Now,
                BargainNumber = "Opp 123456",
                OpportunityName = "Test opp",
                Client = "My client",
                Account = "My account",
                GMP = "GMP Ivan",
                GIP = "GIP Petr",
                Prodavec = "Seller Ashot",
                DealCost = 150,
                Buget = 250,
                Marga = 50,
                Marga_Percent = 88,
                MargaVendor = 70,
                MargaVendor_Percent = 99,
                MargaWork = 55,
                MargaWork_Percent = 80,
                FinRes = 300,
                FinRes_Percent = 100,
                Duration = 52,
                DeliveryDuration = 15,
                Pay = 120,
                Avans = 99,
                Distribution_rmdp = "88,9",
                Pay_for_sale = 11,
                Pay_for_sale_type = "TestType",
                Risks = 22,
                WarrantyCost = 31,
                Transit = 17,
                Credit_Percent = 12,
                Credit = 81,
                Bank_Percent = 65,
                Bank = 33,
                NalogNS_Percent = 71,
                NalogNS = 44,
                TotalDopCost = 12,
                TotalProdBuy = 45,
                TotalProdCost = 47,
                TotalDeliveryCost = 11,
                TotalProdMarga = 18,
                TotalProdMarga_Percent = 82
            };

            return ps;
            //throw new NotImplementedException();
        }
    /// <summary>
    /// This procedure contains the user code. Input parameters are provided as regular arguments,
    /// Output parameters as ref arguments. You don't have to assign output parameters,
    /// they will have a default value.
    /// </summary>


    private void RunScript(List <object> Goals, bool Reset, bool Step, ref object A, ref object B, ref object C, ref object D, ref object E, ref object F)
    {
        // <Custom code>
        if (Reset)
        {
            PS      = new KangarooSolver.PhysicalSystem();
            counter = 0;
            GoalList.Clear();
            foreach (IGoal G in Goals)      //Assign indexes to the particles in each Goal:
            {
                PS.AssignPIndex(G, 0.0001); // the second argument is the tolerance distance below which points combine into a single particle
                GoalList.Add(G);
            }
        }
        if (Step)
        {
            PS.SimpleStep(GoalList);
            counter++;
        }


        A = PS.GetOutput(GoalList);
        B = counter;
        C = PS.GetAllMoves(GoalList);
        D = PS.GetAllWeightings(GoalList);
        E = PS.GetPositionArray();

        var Names = new List <String> [PS.ParticleCount()];

        for (int i = 0; i < PS.ParticleCount(); i++)
        {
            Names[i] = new List <String>();
        }

        for (int i = 0; i < GoalList.Count; i++)
        {
            var  FullName = GoalList[i].ToString();
            Char splitter = '.';
            var  Name     = FullName.Split(splitter);
            if (Name[0] != "KangarooSolver")
            {
                Name = FullName.Split('_', '+');
            }
            var G = GoalList[i] as IGoal;

            for (int j = 0; j < G.PIndex.Count(); j++)
            {
                Names[G.PIndex[j]].Add(Name[2]);
            }
        }


        F = Names;
        // </Custom code>
    }
Exemplo n.º 30
0
 private void StopChargingFxs()
 {
     foreach (ParticleSystem PS in chargingPartSystList)
     {
         PS.Stop();
     }
     foreach (ParticleSystem PS in chargingMainSystList)
     {
         PS.Stop();
     }
 }
Exemplo n.º 31
0
 private void processIsFireball()
 {
     if (isFireball)
     {
         gameObject.tag = tags.FIREBALL;
     }
     foreach (ParticleSystem PS in GetComponentsInChildren <ParticleSystem>())
     {
         PS.Play();
     }
 }