Exemple #1
0
    [UnityTest] public IEnumerator LazerAccends()
    {
        Shit       shit     = v.GetShit();
        GameObject lazer    = shit.SpawnLazer();
        float      initialY = lazer.transform.position.y;

        yield return(new WaitForSeconds(0.1f));

        Assert.Greater(lazer.transform.position.y, initialY);
    }
Exemple #2
0
    [UnityTest] public IEnumerator LazerDestroyesAss()
    {
        Shit       shit    = v.GetShit();
        GameObject lazer   = shit.SpawnLazer();
        Spawner    spawner = v.spawner;
        GameObject ass     = spawner.SpawnAssteroid();

        lazer.transform.position = ass.transform.position;
        yield return(new WaitForSeconds(0.1f));

        UnityEngine.Assertions.Assert.IsNull(ass);
    }
Exemple #3
0
        private static void DemoString(string inputText)
        {
            Console.WriteLine("Исходный текст --->>>");
            Console.WriteLine(inputText);

            var encryptor = new Shit(128, 16);

            var encrypted = encryptor.Encrypt(inputText);

            Console.WriteLine("Зашифрованный текст --->>>");
            Console.WriteLine(encrypted);

            var decrypted = encryptor.Decode(encrypted);

            Console.WriteLine("Расшифрованный текст --->>>");
            Console.WriteLine(decrypted);
        }
Exemple #4
0
    // Use this for initialization
    private void Start()
    {
        if (File.Exists("shit.bin"))
        {
            using (var stream = File.OpenRead("shit.bin"))
            {
                var serializer = new FlexiSerializer(this)
                {
                    Layout = FlexiSerializationLayout.Mapping
                };
                var shit = serializer.Deserialize <Shit>(stream);
                Debug.Log(shit);
            }
        }
        else
        {
            var shit = new Shit(100, "F**k this", true,
                                new Ass(-99, null, true,
                                        new[]
            {
                Quaternion.identity, Quaternion.Euler(90, 0, 0), Quaternion.Euler(0, 90, 0),
                Quaternion.Euler(0, 0, 90)
            }), new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 }, Vector3.one)
            {
                Bytes = new byte[] { 128, 255 }, List = new List <string>()
                {
                    "lucas", "cindy", "moron"
                }
            };

            var serializer = new FlexiSerializer(this)
            {
                Layout = FlexiSerializationLayout.Mapping
            };

            using (var stream = File.OpenWrite("shit.bin"))
            {
                serializer.Serialize(shit, stream);
            }

            var sb = new StringBuilder();
            serializer.Encode(shit, sb);
            File.WriteAllText("shit.txt", sb.ToString());
        }
    }
Exemple #5
0
    /// <summary>
    /// 进行呕吐攻击
    /// </summary>
    private void Vomit()
    {
        if (playerInfo.getRepletion() < 5)
        {
            return;                                 //饱食度小于5攻击
        }
        playerInfo.vomit(5);
        GameObject shit = Instantiate(shitPrefab, vomitPos, Quaternion.identity) as GameObject;
        Shit       shi  = shit.GetComponent <Shit>();

        shi.target     = targetRole.transform;
        shi.OnTrigger += () =>
        {
            targetRole.BeVomitted();
            Destroy(shit, 0.1f);
        };
        shit.transform.DOMove(targetRole.transform.position, 1f);
    }
Exemple #6
0
    [UnityTest] public IEnumerator GameOverOccursOnAssCollision()
    {
        Spawner    spawner = v.spawner;
        GameObject ass     = spawner.SpawnAssteroid();

        Shit       shit = v.GetShit();
        GameObject fan  = shit.gameObject;

        ass.transform.position = fan.transform.position;

        Time.timeScale = 1;
        yield return(null);

        if (Time.timeScale == 0)
        {
            Time.timeScale = 1;
        }
        yield return(new WaitForSeconds(0.1f));

        Assert.True(v.isGameOver);
    }
Exemple #7
0
        private void Timer_Tick(object sender, EventArgs e)
        {
            Random r       = new Random();
            int    eggtype = r.Next(0, 3);

            Eggs.Eggs egg;
            if (eggtype == 0)
            {
                egg = new WhileEgg(this);
            }
            if (eggtype == 1)
            {
                egg = new GoldenEgg(this);
                egg.rigitbody.gravitationSpeed = 30;
            }
            if (eggtype == 2)
            {
                egg = new Shit(this);
            }
            timer.Stop();
            timer.Start();
        }
Exemple #8
0
        private static void DemoFile(string inputPath, string resultPath)
        {
            FileInfo fileInfo = new FileInfo(inputPath);
            var      ext      = fileInfo.Extension;

            var data = new byte[fileInfo.Length];

            using (FileStream fs = fileInfo.OpenRead())
            {
                fs.Read(data, 0, data.Length);
            }

            string fileStr = "";

            foreach (var bt in data)
            {
                fileStr += (char)bt;
            }

            var encryptor = new Shit();

            var encrypted = encryptor.Encrypt(fileStr);

            var decrypted = encryptor.Decode(encrypted);

            var dataN = new List <byte>();

            foreach (var btc in decrypted)
            {
                dataN.Add((byte)btc);
            }

            using (BinaryWriter writer = new BinaryWriter(File.Open(Path.Combine(resultPath, $"result{ext}"), FileMode.Create)))
            {
                writer.Write(dataN.ToArray());
            }
        }
Exemple #9
0
    void Update()
    {
        if (Input.GetKeyDown(switchKey) && flag == false)
        {
            enemy[index].GetComponent <Vomit>().RemovePoint(pointer);

            if (index == 2)
            {
                index = 0;
            }
            else
            {
                index++;
            }

            pointer.transform.position = enemyPointerOffset[index].position;

            enemy[index].GetComponent <Vomit>().Pointed(pointer);
        }

        enemyInfo = enemy[index].GetComponent <Role>().playerInfo;


        if (Input.GetKeyDown(vomitKey) && thisinfo.getRepletion() >= 5)
        {
            thisinfo.vomit(5);
            shit = Instantiate(shitPrefab, vomitOffset.position, vomitOffset.rotation) as GameObject;
            Shit shi = shit.GetComponent <Shit>();
            shi.target     = enemy[index].transform;
            shi.OnTrigger += Shi_OnTrigger;
            shit.transform.DOMove(enemy[index].transform.position, 1.2f);
            Destroy(shit, 3f);
        }

        ArrangePos();
    }
Exemple #10
0
 public bool Equals(Shit <T> other)
 {
     throw new NotSupportedException();
 }
Exemple #11
0
        public void receive_data()
        {
            while (true)
            {
                string strMsg = reader.ReadLine();
                if (string.IsNullOrEmpty(strMsg))
                {
                    continue;
                }
                //MessageBox.Show("Reading");
                //writer.Write("ignore\n");
                //writer.Flush();
                Message msg = JsonConvert.DeserializeObject <Message>(strMsg);
                //MessageBox.Show(line);
                if (msg.type == "disassembly")
                {
                    f**k = JsonConvert.DeserializeObject <List <ProcInfoRow> >(msg.content);
                    oSignalEvent.Set();
                }

                else if (msg.type == "debugger current")
                {
                    Shit        shit = JsonConvert.DeserializeObject <Shit>(msg.content);
                    ProcInfoRow pir  = disassembly.CurrentRow.DataBoundItem as ProcInfoRow;
                    if (pir != null)
                    {
                        pir.isCurrent = "";
                    }

                    int currentStep;

                    ProcEntry fuckass = procInfos[shit.procname];
                    for (int i = 0; i < fuckass.disassembly.Count; i++)
                    {
                        procInfos[shit.procname].disassembly[i].isCurrent = "";
                        if (procInfos[shit.procname].disassembly[i].Offset == shit.offset)
                        {
                            procInfos[shit.procname].disassembly[i].isCurrent = ">";
                            currentStep = i;
                        }
                    }

                    Invoke(new Action(() =>
                    {
                        int hack                                    = disassembly.FirstDisplayedScrollingRowIndex;
                        int current                                 = disassembly.CurrentRow.Index;
                        BindingSource bs                            = new BindingSource();
                        bs.DataSource                               = procInfos[shit.procname].disassembly;
                        disassembly.DataSource                      = bs;
                        disassembly.Rows[current].Selected          = true;
                        disassembly.FirstDisplayedScrollingRowIndex = hack;
                    }));
                }

                else if (msg.type == "local variables" && msg.content != null)
                {
                    //MessageBox.Show(msg.content);
                    List <LocalVariable> locals = JsonConvert.DeserializeObject <List <LocalVariable> >(msg.content);
                    Invoke(new Action(() =>
                    {
                        BindingSource bs = new BindingSource();
                        if (locals != null)
                        {
                            bs.DataSource = locals;
                        }
                        else
                        {
                            bs.DataSource = new List <LocalVariable>();
                        }
                        localVariables.DataSource = bs;
                    }));
                }

                else if (msg.type == "arguments" && msg.content != null)
                {
                    //MessageBox.Show(msg.content);
                    List <Argument> args = JsonConvert.DeserializeObject <List <Argument> >(msg.content);
                    Invoke(new Action(() =>
                    {
                        BindingSource bs = new BindingSource();
                        if (args != null)
                        {
                            bs.DataSource = args;
                        }
                        else
                        {
                            bs.DataSource = new List <Argument>();
                        }
                        arguments.DataSource = bs;
                    }));
                }

                else if (msg.type == "stack" && msg.content != null)
                {
                    //MessageBox.Show(msg.content);
                    List <Argument> args = JsonConvert.DeserializeObject <List <Argument> >(msg.content);
                    Invoke(new Action(() =>
                    {
                        BindingSource bs = new BindingSource();
                        if (args != null)
                        {
                            bs.DataSource = args;
                        }
                        else
                        {
                            bs.DataSource = new List <Argument>();
                        }

                        procStack.DataSource = bs;
                    }));
                }

                else if (msg.type == "callstack" && msg.content != null)
                {
                    //MessageBox.Show(msg.content);
                    List <string> procs = JsonConvert.DeserializeObject <List <string> >(msg.content);

                    Invoke(new Action(() =>
                    {
                        BindingSource bs = new BindingSource();
                        if (procs != null)
                        {
                            bs.DataSource = procs;
                        }
                        else
                        {
                            bs.DataSource = new List <Argument>();
                        }
                        callStack.DataSource = bs;
                    }));
                }
            }
        }
Exemple #12
0
 private void Awake()
 {
     Ss = new Shit();
     NewBehaviourScript1.Say += Ss.Say;
 }