Example #1
0
 public override void Effect1(EntityPlayer player, Emplacement place, OptionEffect opt)
 {
     Printer.Log(40, "Puit Effect1", place.position, place.ipos, opt.OptionBlock.blocks, opt.OptionShape.shape);
     Zombiome.Routines.Named("Puit").Start(
         Routines.Call(biome.groundParticleEffect, place.ipos),
         new WaitForSeconds(1f),
         EffectsCollapse.Puit(player, place, opt)
         );
 }
Example #2
0
 public Form1()
 {
     InitializeComponent();
     Routines.LoadAppConfigSettings();
     Routines.Initialize_Grid();
     Routines.Initialize_Obstructions();
     Routines.GetGridsObstructions();
     Routines.Initialize_Robot();
 }
Example #3
0
 public MainWindow()
 {
     InitializeComponent();
     Routines.Startup(AppInfo.BaseAppInfo);
     Closing        += MainWindow_Closing;
     _timer.Elapsed += Timer_Elapsed;
     _stopWatch.Start();
     _timer.Start();
 }
Example #4
0
        /// <summary>
        /// Generate an HTML DIV tag for design
        /// a given master page generates the page
        /// a page contains master objects related
        /// restricted objects in page are computed equally
        /// </summary>
        /// <param name="refPage">page reference</param>
        /// <param name="masterRefPage">master page reference</param>
        /// <param name="objects">master objects list</param>
        /// <param name="parentConstraint">parent constraint</param>
        /// <returns>html output</returns>
        public OutputHTML GenerateDesignDIV(Page refPage, MasterPage masterRefPage, List <MasterObject> objects, ParentConstraint parentConstraint)
        {
            OutputHTML output = new OutputHTML();
            CodeCSS    myCss  = new CodeCSS(this.CSS);

            if (this.VerticalZones.Count > 0)
            {
                string myId = "horiz" + Project.IncrementedTraceCounter.ToString();

                // compute size
                ParentConstraint newInfos = Routines.ComputeHorizontalZone(parentConstraint, this);
                ConstraintSize   cs       = new ConstraintSize(newInfos.constraintWidth, newInfos.precedingWidth,
                                                               newInfos.maximumWidth, newInfos.constraintHeight,
                                                               newInfos.precedingHeight, newInfos.maximumHeight);

                // set CSS part
                myCss.Ids = "#" + myId;
                Routines.SetCSSPart(myCss, cs);

                string tag;
                this.Attributes.ToHTML("div", myId, myCss, this.Events, output.CSS, out tag);
                output.HTML.Append(tag);


                List <VerticalZone> .Enumerator e = this.VerticalZones.GetEnumerator();
                VerticalZone lastZone             = null;
                if (e.MoveNext())
                {
                    do
                    {
                        if (lastZone != null)
                        {
                            OutputHTML zone = lastZone.GenerateDesignDIV(refPage, masterRefPage, objects, newInfos);
                            output.HTML.Append(zone.HTML.ToString());
                            output.CSS.Append(zone.CSS.ToString());
                            output.JavaScript.Append(zone.JavaScript.ToString());
                            output.JavaScriptOnLoad.Append(zone.JavaScriptOnLoad.ToString());
                        }
                        lastZone = e.Current;
                    } while (e.MoveNext());
                }
                if (lastZone != null)
                {
                    OutputHTML last = lastZone.GenerateDesignDIV(refPage, masterRefPage, objects, newInfos);
                    output.HTML.Append(last.HTML.ToString());
                    output.CSS.Append(last.CSS.ToString());
                    output.JavaScript.Append(last.JavaScript.ToString());
                    output.JavaScriptOnLoad.Append(last.JavaScriptOnLoad.ToString());
                }
                output.HTML.Append("</div>");

                output.JavaScript.Append(this.JavaScript.GeneratedCode);
                output.JavaScriptOnLoad.Append(this.JavaScriptOnLoad.GeneratedCode);
            }
            return(output);
        }
Example #5
0
        public void OnClickGo()
        {
            // ifconfig eth0 192.168.60.1 netmask 255.255.255.0 broadcast 192.169.60.255
            bool wasUp = selectedInterface.IsUp();

            string[] command = new string[] {
                "ifconfig",
                selectedInterface.Name,
                inputDirection.text,
                "netmask",
                inputMask.text,
                "broadcast",
                inputBroadcast.text
            };
            CommandStructure result = Console.ReadCommand(command, node);

            string output = "Command: ";

            foreach (string s in command)
            {
                output += s + " ";
            }
            output += Console.jump;
            if (result.prompt)
            {
                output += result.value;
            }

            if (result.correct && wasUp != toggleIsUp.isOn)               //ifup
            {
                command = new string[] {
                    "ifconfig",
                    selectedInterface.Name,
                    (toggleIsUp ? "up" : "down")
                };
                result = Console.ReadCommand(command, node);
                foreach (string s in command)
                {
                    output += s + " ";
                }
            }

            shellResponseText.text = output;

            if (!shellResponseOut)
            {
                StartCoroutine(Routines.WaitFor(0.2f, delegate {
                    shellResponseOut = true;
                }));
                StartCoroutine(Routines.DoWhile(0.2f, delegate(float f) {
                    shellResponseRect.anchoredPosition = Vector2.Lerp(shellPosIn, shellPosOut, f);
                }));
            }

            LoadValues();
        }
Example #6
0
 public void OnSiblingEntered()
 {
     foreach (GameObject g in childs)
     {
         g.SetActive(false);
     }
     StartCoroutine(Routines.DoWhile(0.1f, delegate(float f) {
         canvasGroup.alpha = 1f - f * 0.3f;
     }));
 }
Example #7
0
 public override void Effect1(EntityPlayer player, Emplacement place, OptionEffect opt)
 {
     Printer.Log(60, "Geyser Effect1", place.position, place.ipos, opt.OptionBlock.blocks, opt.OptionShape.shape);
     Zombiome.Routines.Named("Geyser").Start(
         // treeGib_birch_15m creates falling leaves above smoke :(
         Routines.Call(EffectsItem.SpawnParticle, place.position, "treeGib_burnt_small"),
         new WaitForSeconds(1f),
         EffectsGround.Peak(player, place, opt)
         );
 }
Example #8
0
 public override void Effect1(EntityPlayer player, Emplacement place, OptionEffect opt)
 {
     Printer.Log(40, "Cave Effect1", place.position, place.ipos, opt.OptionBlock.blocks, opt.OptionShape.shape);
     Zombiome.Routines.Named("Cave").Start(
         Routines.Call(biome.groundParticleEffect, place.ipos),
         ZBActivity.Environment.ZBSounds.Play("light_pipebomb", place.position, player, World, 1, 0, 0.2f),
         new WaitForSeconds(1f),
         EffectsCollapse.Cave(player, place, opt)
         );
 }
Example #9
0
 public override void Effect1(EntityPlayer player, Emplacement place, OptionEffect opt)
 {
     Printer.Log(40, "Wave Effect1", place.position, place.ipos, opt.OptionBlock.blocks, opt.OptionShape.shape);
     Zombiome.Routines.Named("Wave").Start(
         Routines.Call(biome.groundParticleEffect, place.ipos),
         // Routines.Call(__BUG), // TEST
         new WaitForSeconds(1f),
         EffectsGround.Wave(player, place, opt)
         );
 }
Example #10
0
 public void Play()
 {
     source.Play();
     if (!loop)
     {
         StartCoroutine(Routines.WaitFor(clip.length, delegate {
             Stop();
         }));
     }
 }
Example #11
0
 void Start()
 {
     AnimateLineGroupUp(bot, 6f);
     StartCoroutine(Routines.WaitFor(6f, delegate {
         AnimateLineGroup(mid, 3f);
     }));
     StartCoroutine(Routines.WaitFor(9f, delegate {
         AnimateLineGroupUp(top, 6f);
     }));
 }
Example #12
0
        public static void LoadCharities()
        {
            charityDatabase.AppendCharity("Programming");
            charityDatabase.AppendCharity("Is");
            charityDatabase.AppendCharity("Fun");

            Routines.Add(new CharitySelection(charityDatabase));
            Routines.Add(new CharityDonation(charityDatabase));
            Routines.Add(new Callback());
        }
Example #13
0
    public override void Interrupt(Motive motive)
    {
        if (routine == null)
        {
            return;
        }

        Routines.Stop(routine);
        routine = null;
    }
Example #14
0
 public override void Effect1(EntityPlayer player, Emplacement place, OptionEffect opt)
 {
     Printer.Log(40, "TrapLine Effect1", place.position, place.ipos, opt.OptionBlock.blocks, opt.OptionShape.shape);
     Zombiome.Routines.Named("TrapLine").Start(
         Routines.Call(biome.groundParticleEffect, place.ipos),
         ZBActivity.Environment.ZBSounds.Play(this.biome.groundNoise, place.position, player, World, 2, 0, 0.2f),
         new WaitForSeconds(1f),
         EffectsGround.TrapLine(player, place, opt)
         );
 }
Example #15
0
        void Awake()
        {
            // Create the EventArgs which will be sent to the sequence & subscribe to its callback to resume logic after the feedback is done
            var args = new CustomArgs(channel);

            args.onDone += OnDone;

            // Call the event after 0.75seconds
            StartCoroutine(Routines.DoAfter(() => Events.Call(Feedback.Unique, args), 0.75f));
        }
Example #16
0
 public override void Effect1(EntityPlayer player, Emplacement place, OptionEffect opt)
 {
     Printer.Log(60, "Peak Effect1", place.position, place.ipos, opt.OptionBlock.blocks, opt.OptionShape.shape);
     // FIXME: this syntax cannot be merged !
     Zombiome.Routines.Named("Peak").Start(
         // treeGib_birch_15m creates falling leaves above smoke :(
         Routines.Call(biome.groundParticleEffect, place.ipos), // "treeGib_burnt_small"
         new WaitForSeconds(1f),
         EffectsGround.Peak(player, place, opt)
         );
 }
Example #17
0
 public void FadeColor(Color color, float duration, bool ignoreTimeScale)
 {
     if (debug)
     {
         StratusDebug.Log("Fading to " + color, this);
     }
     previousColor = currentColor;
     currentColor  = color;
     //image.CrossFadeColor(color, duration, ignoreTimeScale, useAlpha);
     this.StartCoroutine(Routines.Lerp(image.color, color, duration, (Color val) => { image.color = val; }, Color.Lerp), "Fade Color");
 }
Example #18
0
 public void OnEndTurn()
 {
     if (!isActive)
     {
         return;
     }
     Routines.Start(Routines.DoAfter(() =>
     {
         onIntendedTurnStop?.Invoke(new IntendedStopMotive());
     }, new YieldFrame()));
 }
Example #19
0
        public async Task ActivateDeviceGrain(string color)
        {
            if (!AzureClient.IsInitialized)
            {
                AzureClient.Initialize(this.Server.MapPath("~/AzureClientConfiguration.xml"));
            }

            var ipAddress   = Routines.GetIPAddress();
            var decodeGrain = GrainClient.GrainFactory.GetGrain <IDecodeGrain>(ipAddress);
            await decodeGrain.DecodeDeviceMessage(string.Format("{0},{1}", ipAddress, color));
        }
Example #20
0
 //--------------------------------------------------------------------------------------------/
 // Methods
 //--------------------------------------------------------------------------------------------/
 public void Fade(float alpha, float duration, bool ignoreTimeScale)
 {
     if (debug)
     {
         StratusDebug.Log("Fading to " + alpha, this);
     }
     previousAlpha = currentAlpha;
     currentAlpha  = alpha;
     //image.CrossFadeAlpha(alpha, duration, ignoreTimeScale);
     this.StartCoroutine(Routines.Lerp(image.color.a, alpha, duration, (float val) => { image.color = image.color.ToAlpha(val); }, Routines.Lerp), "Fade");
 }
Example #21
0
 public override void Effect1(EntityPlayer player, Emplacement place, OptionEffect opt)
 {
     Printer.Log(40, "RiftCollapse Effect1", place.position, place.ipos, opt.OptionBlock.blocks, opt.OptionShape.shape);
     // Zombiome.Routines.Start(EffectsCollapse.Rift(player, place, opt), "RiftCollapse");
     Zombiome.Routines.Named("RiftCollapse").Start(
         Routines.Call(biome.groundParticleEffect, place.ipos),
         ZBActivity.Environment.ZBSounds.Play(ZBiomeInfo.NoiseCollapse, place.position, player, World, 1, 20, 0.2f),
         new WaitForSeconds(1f),
         EffectsCollapse.Rift(player, place, opt)
         );
 }
Example #22
0
 public RoutineStateRecord GetRoutineRecord(string routineId)
 {
     lock (Routines)
     {
         if (Routines.TryGetValue(routineId, out var routineRecord))
         {
             return(routineRecord);
         }
     }
     throw new InvalidOperationException($"Routine with ID '{routineId}' does not exist.");
 }
Example #23
0
        //---[Initialization]-------------------------------------------------------------------------------------------/

        void OnEnable()
        {
            // Random state assignement
            speed = Random.Range(speedRange.x, speedRange.y);
            var size = Random.Range(0.5f, 1.25f);

            transform.localScale = Vector3.one * size;

            // A poolable will automatically return to its corresponding pool once its disabled
            // It is preferable to deactivate its GameObject entirely to avoid any issue
            StartCoroutine(Routines.DoAfter(() => gameObject.SetActive(false), lifeTime));
        }
Example #24
0
 public void OnClickCloseShell()
 {
     if (shellResponseOut)
     {
         StartCoroutine(Routines.WaitFor(0.2f, delegate {
             shellResponseOut = false;
         }));
         StartCoroutine(Routines.DoWhile(0.2f, delegate(float f) {
             shellResponseRect.anchoredPosition = Vector2.Lerp(shellPosOut, shellPosIn, f);
         }));
     }
 }
Example #25
0
        private void FormGame_Load(object sender, EventArgs e)
        {
            if (user is null)
            {
                button1.Enabled = false;
                button2.Enabled = false;
            }

            button2.Select();

            textBox1.Text = game.Name;
            textBox2.Text = game.Developer;
            textBox3.Text = game.Rating;
            textBox4.Text = ((DateTime)game.Release_date).Date.ToString("dd/MM/yyyy");
            textBox5.Text = game.Average_user_review.ToString();
            textBox6.Text = game.Average_reviewer_score.ToString();

            string cat = "";

            foreach (Category c in game.Categories)
            {
                cat += c.ToStringHeader() + ", ";
            }
            cat = cat.Remove(cat.Length - 2);

            textBox7.Text = cat;

            textBox8.Text = game.Description;

            string workingDirectory = Environment.CurrentDirectory;
            string projectDirectory = Directory.GetParent(workingDirectory).Parent.FullName;

            pictureBox1.ImageLocation = projectDirectory + @"\resources\" + game.Game_id + ".jpg";

            Routines routines = new Routines();

            for (int i = 0; i < 10; i++)
            {
                Tuple <string, int> tuple = routines.lastTenReviews(game.Game_id);
                if (tuple.Item1 == "null")
                {
                    textBox9.Text = game.Name + Environment.NewLine + "does not have enough reviews";
                    break;
                }
                else
                {
                    textBox9.Text += tuple.Item1 + " " + tuple.Item2 + Environment.NewLine;
                }
            }

            button2.Text = "Add " + game.Name + " to your favorite games";
        }
Example #26
0
    protected override void ApplyTo(Tile source, IEnumerable <Tile> tiles, IReadOnlyDictionary <Id, List <CastArgs> > args)
    {
        var entities = tiles.SelectMany(tile => tile.Entities);

        if (!entities.Any())
        {
            End();
            return;
        }

        target = entities.First();
        Routines.Start(Execute());
    }
Example #27
0
        public override IEnumerator Apply(EntityPlayer player, EntityAlive target, OptionEffect opt)
        {
            Vector3     pos   = target.GetPosition();
            Emplacement place = Emplacement.At(pos, Placer.directions.Generate(pos));

            Printer.Log(40, "Peak Effect1", place.position, place.ipos, opt.OptionBlock.blocks, opt.OptionShape.shape);
            Zombiome.Routines.Named("PeakAt").Start(
                Routines.Call(biome.groundParticleEffect, place.ipos),
                new WaitForSeconds(1f),
                EffectsGround.Peak(player, place, opt)
                );
            yield break;
        }
Example #28
0
        private async void clear_Click(object sender, RoutedEventArgs e)
        {
            var messageDialog = new Windows.UI.Popups.MessageDialog("Warning");

            messageDialog.Title   = "Warning !!!";
            messageDialog.Content = "This will clear all settings and library contents and cannot be restored.\nAre you sure you want to continue?";
            messageDialog.Commands.Add(new UICommand("Yes", new UICommandInvokedHandler(this.CommandInvokedHandler)));
            messageDialog.Commands.Add(new UICommand("No", new UICommandInvokedHandler(this.CommandInvokedHandler)));
            messageDialog.DefaultCommandIndex = 0;
            messageDialog.CancelCommandIndex  = 1;
            await messageDialog.ShowAsync();

            Routines.DisplayMsg("Restart", "Please restart the app to add new books.");
        }
Example #29
0
        public override void Shoot(Aim aim, EventArgs args)
        {
            deactivationTimer = deactivationTime;
            hasHit            = false;

            base.Shoot(aim, args);

            trail.enabled = true;
            routine       = StartCoroutine(Routines.DoAfter(() =>
            {
                graph.SetActive(true);
                routine = null;
            }, 0.15f));
        }
Example #30
0
 void PrepareLateRoutineBuilders()
 {
     // builders for routines (again, in case any were added during compilation, e.g. by a PROPSPEC)
     foreach (var routine in Context.ZEnvironment.Routines)
     {
         Debug.Assert(routine.Name != null);
         if (!Routines.ContainsKey(routine.Name))
         {
             Routines.Add(routine.Name, Game.DefineRoutine(
                              routine.Name.Text,
                              routine.Name == Context.ZEnvironment.EntryRoutineName,
                              (routine.Flags & RoutineFlags.CleanStack) != 0));
         }
     }
 }