private void EditMedia_Click(object sender, RoutedEventArgs e)
        {
            DataRow selectedRow = ((DataRowView)GetSelectedRow().DataContext).Row;
            Boolean valid = false;
            if (((String)selectedRow["Type"]).Equals("Video"))
            {
                _SelectedMedia = new Video((String)selectedRow["Name"], (String)selectedRow["Path"], (String)selectedRow["Size"], Int32.Parse((String)selectedRow["Rating"]), (((String)selectedRow["IsHD"]).Equals("true")));
                valid = true;
            }
            else if (((String)selectedRow["Type"]).Equals("Audio"))
            {
                _SelectedMedia = new Audio((String)selectedRow["Name"], (String)selectedRow["Path"], (String)selectedRow["Size"], Int32.Parse((String)selectedRow["Rating"]), (String)selectedRow["AudioType"]);
                valid = true;
            }
            else if (((String)selectedRow["Type"]).Equals("Image"))
            {
                _SelectedMedia = new Image((String)selectedRow["Name"], (String)selectedRow["Path"], (String)selectedRow["Size"], Int32.Parse((String)selectedRow["Rating"]));
                valid = true;
            }

            if (valid)
            {
                _SelectedMedia.SetID(Int32.Parse((String)selectedRow["ID"]));

                Debug debug = new Debug();
                debug.Show("APPEL EDITMEDIA AVEC ID " + _SelectedMedia.GetID());

                MediaWindow mediaWindow = new MediaWindow(_SelectedMedia);
                mediaWindow.ShowDialog();
            }
             
        }
Beispiel #2
0
        public override void Load()
        {
            base.Load();

            PrelightingRenderer.game = game;
            debug = new Debug();

            Sky = new SkySphere(content, graphicsDevice, content.Load<TextureCube>("Textures\\SkyBox\\SkyBoxTex"), 10000);

            terrain = new Terrain(content.Load<Texture2D>("Textures\\Terrain\\terrain"), 100, 8000, -6000,
                content.Load<Texture2D>("Textures\\Terrain\\grass"), 6, new Vector3(1, -1, 0), graphicsDevice, content);
            terrain.WeightMap = content.Load<Texture2D>("Textures\\color1");
            terrain.RTexture = content.Load<Texture2D>("Textures\\Terrain\\sand");
            terrain.GTexture = content.Load<Texture2D>("Textures\\Terrain\\grass");
            terrain.BTexture = content.Load<Texture2D>("Textures\\Terrain\\stone");
            terrain.DetailTexture = content.Load<Texture2D>("Textures\\detail0");

            Water.game = game;
            water = new Water(content, graphicsDevice, new Vector3(0, -1800, -4000), new Vector2(5000, 5000));
            //water = new Water(content, device, new Vector3(0, 0, 0), new Vector2(1000, 1000), renderer);
            water.Objects.Add(Sky);
            water.Objects.Add(terrain);
            //water.Objects.Add(models[0]); water.Objects.Add(models[1]);
            foreach (Object o in Models) {
                water.Objects.Add(o);
            }
            water.Initialize();
        }
Beispiel #3
0
        public static Debug GetInstance()
        {
            if (debug == null)
                debug = new Debug();

                return debug;
        }
        public Debug GetTimings(string transactionId)
        {
            var transactionIdGuid = Guid.Parse(transactionId);
            var profilerDataContext = new ProfilerDbDataContext();
            var traces = profilerDataContext.GetTraceAndTimings(transactionIdGuid);

            Debug result = new Debug();

            List<Timing> allTimings = new List<Timing>();
            foreach (var trace in traces)
            {
                if (trace.IsRoot.GetValueOrDefault() == true) {
                    BuildDebugAndRoot(trace, result);
                }
                else{
                    var timing = new Timing();
                    BuildTiming(trace, timing);
                    BuildSqlTimingCount(trace, timing);
                    allTimings.Add(timing);
                }
            }

            if(allTimings.Count > 0)
                MapChildren(result.Head, allTimings);
            return result;
        }
        public void Save(Debug debugResult, bool async)
        {
            Action<Debug> action = (debug) => {
                using (var profilerDataContext = new ProfilerDbDataContext())
                {
                    var transactionId = Guid.Empty;
                    Guid.TryParse(debug.TransactionId, out transactionId);

                    profilerDataContext.InsertProfilerDebug(Guid.Parse(debug.Id), debug.Name, debug.Method,
                        debug.RequestUrl, debug.MachineName, debug.UserName, debug.StartedUtc,
                        transactionId, debug.Code, debug.Level);

                    if (debug.Head != null)
                    {
                        var timing = debug.Head;
                        InsertTimings(profilerDataContext, transactionId, timing);
                    }
                }
            };

            if (RequiredToSave() == true)
            {
                if (async)
                    action.BeginInvoke(debugResult, null, null);
                else
                    action.Invoke(debugResult);
            }
        }
        /// <summary>
        /// Constructs a ProtocolReporter
        /// </summary>
        /// <param name="protocol">Protocol to attach to</param>
        public ProtocolReporter(Protocol protocol)
        {
            this.protocol = protocol;
            this.debug = new Debug(protocol.Name);

            this.protocol.AddListener(this);
        }
Beispiel #7
0
 public void LoadGameInterface()
 {
     inputManager = new InputManager(this);
     AddInput();
     debug = new Debug(Content, spriteBatch);
     fps = new FpsManager(Content, spriteBatch);
 }
Beispiel #8
0
 /// <summary>
 /// Adds a debuggable object to the table
 /// </summary>
 /// <param name="value">The value to add</param>
 public static void Add(Debug value)
 {
     // Ensure the name is unique
     while (_table.ContainsKey(value.Name))
     {
         value.Name += new Random().Next(10);
     }
     _table.Add(value.Name, value);
 }
Beispiel #9
0
 public Home()
 {
     InitializeComponent();
     var materialSkinManager = MaterialSkinManager.Instance;
     materialSkinManager.AddFormToManage(this);
     materialSkinManager.Theme = MaterialSkinManager.Themes.DARK ;
     materialSkinManager.ColorScheme = new ColorScheme(Primary.Blue600, Primary.Blue900, Primary.Blue500, Accent.Blue200, TextShade.WHITE);
     debug = new Debug();
 }
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            fps = new FPSCounter(this);
            debug = new Debug(this);

            this.Components.Add(fps);
            this.Components.Add(debug);

            base.Initialize();
        }
Beispiel #11
0
 public bool HasChangedFrom(Debug obj)
 {
     return false
     || (!EqualityComparer<StartAction?>.Default.Equals(StartActionQ, obj.StartActionQ))
     || (!EqualityComparer<System.String>.Default.Equals(ExternalProgram, obj.ExternalProgram))
     || (!EqualityComparer<System.String>.Default.Equals(CommandLineArgs, obj.CommandLineArgs))
     || (!EqualityComparer<System.String>.Default.Equals(WorkingDir, obj.WorkingDir))
     || (!EqualityComparer<System.String>.Default.Equals(DebuggerScript, obj.DebuggerScript))
     ;
 }
Beispiel #12
0
 /// <summary>
 /// Complex constructor for filter thread
 /// </summary>
 /// <param name="logName">EventLog name</param>
 /// <param name="syslog">Syslog server, protocol and port definition</param>
 /// <param name="rulesList">Rules for find eventLog</param>
 /// <param name="debug">Permit to write debug lines</param>
 /// <param name="lastExecTime">Min time search</param>
 /// <param name="maxExecTime">Mas time search</param>
 /// <param name="doneEvent">ManualResetEvent object to know if process if complit</param>
 public ThreadFilter(String logName, ref SyslogServer syslogServer, ArrayList iFilters, ArrayList eFilters, ref Debug debug,
     DateTime lastExecTime, DateTime maxExecTime, ManualResetEvent doneEvent)
 {
     _LogName = logName;
     _SyslogServer = syslogServer;
     _Debug = debug;
     _LastExecTime = lastExecTime;
     _MaxExecTime = maxExecTime;
     _iFilters = iFilters;
     _eFilters = eFilters;
     _DoneEvent = doneEvent;
 }
 private void buttonDebug_Click(object sender, RibbonControlEventArgs e)
 {
     try
     {
         this.debugForm = Debug.Instance;
         debugForm.ShowDialog();
     }
     catch (Exception ex)
     {
         System.Windows.Forms.MessageBox.Show(ex.Message);
     }
 }
Beispiel #14
0
        //        public delegate void AddTagInformation(string tagname);

        //        public void AddTagInfo(string tagname)
        //        {
        //            dataGridView1.Rows.Add();
        //            dataGridView1.Rows[dataGridView1.RowCount - 1].Cells[0].Value = tagname;
        //            dataGridView1.Rows[dataGridView1.RowCount - 1].DefaultCellStyle.BackColor = Color.Green;
        //            Sectors.Clear();
        //        }

        private void loadToolStripMenuItem_Click(object sender, EventArgs e)
        {
            toolStripComboBox1.Items.Clear();
            dataGridView1.Rows.Clear();
            Debugger deb = new Debugger();
            Blocks.ReloadBlocks();
            string dir = @"E:\Users\root\Documents\Sunfish 2011\Projects\headlong2\bin";
            string[] paths = Directory.GetFiles(dir, "*.map");
            List<Header> Headers = new List<Header>();
            Debug debug = new Debug(DoShit);
            foreach (string path in paths)
            {
                FileStream file = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Delete | FileShare.ReadWrite, 512, FileOptions.SequentialScan);
                map = new Map(file);
                if (map.Header.Type == Sunfish.Header.MapType.Multiplayer)
                {
                    for (tagIndex = 0; tagIndex < map.Index.TagInfoCount; tagIndex++)
                    {
                        deb.DebugTag(tagIndex, map);
                    }
                }
                List<string> shit = new List<string>();
                List<Sunfish.ValueTypes.StringId> nigg = new List<Sunfish.ValueTypes.StringId>();
                List<int> f**k = new List<int>();
                foreach (string s in map.StringIdNames)
                {
                    if (!deb.Strings.Contains(s))
                    {
                        shit.Add(s);
                        Sunfish.ValueTypes.StringId sf = new Sunfish.ValueTypes.StringId() { Index = (short)map.StringIdNames.IndexOf(s), Length = (sbyte)Encoding.UTF8.GetByteCount(s) };

                        nigg.Add(sf);
                        f**k.Add((int)sf);
                    }
                }
                int findAddress = 29814640;
                for (tagIndex = 0; tagIndex < map.Index.TagInfoCount; tagIndex++)
                {
                    int offset, length;
                    if (map.Index.TagEntries[tagIndex].Type == "sbsp" || map.Index.TagEntries[tagIndex].Type == "ltmp")
                    {
                        offset = map.Index.TagEntries[tagIndex].VirtualAddress - map.PrimaryMagic; length = map.Index.TagEntries[tagIndex].Length;
                    }
                    else
                    {
                        offset = map.Index.TagEntries[tagIndex].VirtualAddress - map.SecondaryMagic; length = map.Index.TagEntries[tagIndex].Length;
                    }
                    if (findAddress >= offset && findAddress < offset + length)
                    { }
                }
            }
        }
Beispiel #15
0
 public PropertyBag(MineWorldClient gamein,GameStateManager gameManagerin)
 {
     Game = gamein;
     GameManager = gameManagerin;
     NetPeerConfiguration netconfig = new NetPeerConfiguration("MineWorld");
     netconfig.EnableMessageType(NetIncomingMessageType.DiscoveryResponse);
     Client = new NetClient(netconfig);
     Client.Start();
     Player = new Player(this);
     WorldManager = new WorldManager(GameManager, Player);
     ClientListener = new ClientListener(Client, this);
     ClientSender = new ClientSender(Client, this);
     Debugger = new Debug(this);
 }
Beispiel #16
0
        public static void log(string msg)
        {
            if (Debug.instance == null)
            {
                Debug.instance = new Debug();
                Debug.instance.Show();
            }
            Debug.instance.DebugOut.Text += (msg + "\n");

            if (!Debug.instance.IsVisible)
            {
                Debug.instance.Show();
            }

            Debug.instance.DebugOut.ScrollToEnd();
        }
Beispiel #17
0
        private async void toolStripButton2_Click(object sender, EventArgs e)
        {
            var f = new Debug();
            f.MdiParent = this;
            f.Show();
            try
            {
                Global.SerialPipe.StartPipe();
            }
            catch(Exception ee)
            {
                Global.SerialPipe.StopPipe();
                Global.DebugOutPut += "\n\n-------------------------------------------------------\n\n Gebugging pipe closed\n";
            }

        }
Beispiel #18
0
        public static void Init(string logFilePath)
        {
            try
            {
                if (debugInstance == null)
                {
                    debugInstance = new Debug(logFilePath);
                    debugInstance.logThread = new Thread(new ThreadStart(debugInstance.monitorLogQueue));
                    debugInstance.logThread.Start();
                }
            }

            catch (Exception E)
            {
                throw new Exception("Could not initialize logging - " + E.Message);
            }
        }
Beispiel #19
0
	static int _CreateDebug(IntPtr L)
	{
		int count = LuaDLL.lua_gettop(L);

		if (count == 0)
		{
			Debug obj = new Debug();
			LuaScriptMgr.PushObject(L, obj);
			return 1;
		}
		else
		{
			LuaDLL.luaL_error(L, "invalid arguments to method: Debug.New");
		}

		return 0;
	}
Beispiel #20
0
 protected static Debug getDebug(string idObj)
 {
     Debug debug;
     if (idObj==null){
         if (empty==null)
             empty=new Debug();
         return empty;
     }
     else {
         if (!debugs.Keys.Contains(idObj)){
             debug=new Debug();
             debugs.Add(idObj,debug);
         }else{
             debug=debugs[idObj];
         }
         return debug;
     }
 }
Beispiel #21
0
        public QuotientGroup(BigInteger minValue, BigInteger maxValue, List<BigInteger> coFactors, BigInteger maxQuantity)
        {
            if (maxValue <= minValue) { throw new ArgumentOutOfRangeException("maxValue must be greater than minValue"); }
            if (minValue > maxValue) { throw new ArgumentOutOfRangeException("maxValue minus minValue must be greater than or equal to stepValue"); }

            if (coFactors == null) { throw new ArgumentOutOfRangeException("coFactors cannot be null"); }
            if (!coFactors.Any()) { throw new ArgumentOutOfRangeException("coFactors cannot be empty"); }
            if (coFactors.Any(i => i == 0)) { throw new ArgumentOutOfRangeException("coFactors cannot contain a value of zero"); }

            _minReturnValue = minValue;
            _maxReturnValue = maxValue;
            _maxReturnQuantity = maxQuantity;
            _coFactors = coFactors;

            _counterValue = 0;
            _counterValuesReturned = 0;

            debugMetrics = new Debug();
        }
Beispiel #22
0
 public string udp_konfig(string adres, string port, Byte[] sendData)
 {
     UdpClient client = new UdpClient();
     client.Client.ReceiveTimeout = 5000;
     try
     {
         this.adres = IPAddress.Parse(adres);
         this.port = Convert.ToInt32(port);
         IPEndPoint ep = new IPEndPoint(this.adres, this.port);
         client.Connect(ep);
         client.Send(sendData, sendData.Length);
         string returnData = System.Text.Encoding.ASCII.GetString(client.Receive(ref ep));
         client.Close();
         return returnData;
     }
     catch (Exception ex)
     {
         Debug log = new Debug();
         log.MessageLog(ex.ToString());
         client.Close();
         return "Błąd! Sprawdź plik debug.txt";
     }
 }
Beispiel #23
0
        public static void Initialize()
        {
            if (_init) { return; }
            //***********************
            //Initialize Stuff here:
            Fonts.LoadFont("std_small");
            _debugger = new Debug();

            _ihObject = new Inputhandler();
            _textureHandlerObject = new Textures();
            _timeHandlerObject = new Time();
            _sounds = new Sounds();
            Fonts.LoadFont("mainfont");
            Fonts.LoadFont("std");

            _firstScreen = new Game.Aleks.Mainmenu();

            //Don't initialize stuff here:
            //***********************

            BindKeys();
            _init = true;
        }
Beispiel #24
0
    public void Reset()
    {
        updateTimer = true;
        GameObject.FindGameObjectWithTag("confetti").GetComponent <ParticleSystem>().Stop();
        Debug.Log("Stopping confetti");
        AnalyticsEvent.Custom("Level", new Dictionary <string, object>
        {
            { "level", level },
            { "word", actual_word }
        });

        Firebase.Analytics.FirebaseAnalytics.LogEvent("level", "number", level);

        if (gameover != null)
        {
            gameover.SetActive(false);
        }
        reset_canvas.SetActive(false);
        //hp = GameObject.FindGameObjectWithTag("hint_button").GetComponent<hints_panel>();
        hint_shown = 1;
        setReset(false);
        health = 3;
        GameObject.FindGameObjectWithTag("level").GetComponent <Text>().text         = "Level : " + level;
        GameObject.FindGameObjectWithTag("hint_button").GetComponent <Image>().color = Color.white;
        gameObject.SetActive(false);
        //if (bullet != null)
        //   bullet.SetActive(true);
        Incorrect           = new List <char>();
        Correct             = new List <char>();
        CorrectandIncorrect = new List <char>();
        //hp.paused = false;
        h1 = GameObject.FindGameObjectWithTag("heart1");
        h1.GetComponentInChildren <SpriteRenderer>().color = opaque;
        h2 = GameObject.FindGameObjectWithTag("heart2");
        h2.GetComponentInChildren <SpriteRenderer>().color = opaque;
        h3 = GameObject.FindGameObjectWithTag("heart3");
        h3.GetComponentInChildren <SpriteRenderer>().color = opaque;
        //h1.SetActive(true);
        //h2.SetActive(true);
        //h3.SetActive(true);
        string level_status = "";


        if (level >= 1 && level <= 5)
        {
            level_status = "Easy";
        }
        else if (level >= 6 && level <= 12)
        {
            level_status = "Medium";
        }
        else
        {
            level_status = "Hard";
            if (level > 21)
            {
                level        = 1;
                level_status = "Easy";
            }
        }

        List <Dictionary <string, object> > data = CSVReader.Read(level_status);
        var random_index_1 = Random.Range(0, data.Count);

        Debug.Log("3");

        actual_word = data[random_index_1]["word"].ToString();

        while (guessed_wordset.Contains(actual_word.ToUpper()))
        {
            random_index_1 = Random.Range(0, data.Count);
            actual_word    = data[random_index_1]["word"].ToString();
        }
        guessed_wordset.Add(actual_word.ToUpper());
        hint_1   = data[random_index_1]["Hint 1"].ToString();
        hint_2   = data[random_index_1]["Hint 2"].ToString();
        hint_3   = data[random_index_1]["Hint 3"].ToString();
        category = data[random_index_1]["Category"].ToString();
        category = string.Join(" ", category.Split(' ').Select(i => i.Substring(0, 1).ToUpper() + i.Substring(1).ToLower()).ToArray());;

        Debug.Log("4");
        Text cat = GameObject.FindGameObjectWithTag("category").GetComponent <Text>();

        cat.text     = "Category : " + (category);
        word1        = actual_word.ToUpper();
        word_formed  = new string(word1.Distinct().ToArray());
        word_formed1 = word1;
        word_length  = word_formed.Length;
        word_length1 = word_formed1.Length;
        char_arr     = word_formed.ToCharArray();
        remaining    = new string(allCharacters.Except(char_arr).ToArray()).ToCharArray();
        Debug.Log("5");
        //Comment an entire block
        for (int j = 0; j < word_length + 3; j++)
        {
            if (j >= word_length)
            {
                var random_index = Random.Range(0, remaining.Length);
                CorrectandIncorrect.Add(remaining[random_index]);
            }
            else
            {
                CorrectandIncorrect.Add(char_arr[j]);
            }
        }
        //Random index selected to be filled
        var random_letter_selected = Random.Range(0, word_length);
        var random_letter          = char_arr[random_letter_selected];

        //Till here
        for (int j = 0; j < word_length; j++)
        {
            if (char_arr[j] != random_letter)
            {
                Correct.Add(char_arr[j]);
            }
        }
        for (int j = 0; j < remaining.Length; j++)
        {
            Incorrect.Add(remaining[j]);
        }

        Debug.Log(new string(remaining.ToArray()));


        // i++;
        Debug.Log(new string(Incorrect.ToArray()));
        Debug.Log(new string(Correct.ToArray()));
        string s           = "";
        int    totalLength = 0;

        while (totalLength != word_length1)
        {
            Debug.Log("Step 1");
            if (word1[totalLength] != random_letter)
            {
                s += "_ ";
            }
            else
            {
                s += random_letter + " ";
            }
            totalLength += 1;
        }
        Debug.Log("Step 2");
        wordCreated.text = s;
        //else if (i == char_arr.Length)
        // else if (i == CorrectandIncorrect.Count)

        updateLetters();
        if (hp == null)
        {
            hp = GameObject.FindGameObjectWithTag("hint_button").GetComponent <hints_panel>();
        }

        hp.OpenPanel();
    }
Beispiel #25
0
    void updateLetters()
    {
        Text t;

        Debug.Log("Updating letters");
        //if (i < char_arr.Length)
        //if (i < CorrectandIncorrect.Count)
        int selection = increment_letter_selection();
        {
            List <char> tmp_correct   = new List <char>(Correct);
            List <char> tmp_incorrect = new List <char>(Incorrect);

            Debug.Log(new string(tmp_correct.ToArray()));
            Debug.Log(new string(tmp_incorrect.ToArray()));

            GameObject g1  = GameObject.FindGameObjectWithTag("Letter1");
            GameObject g2  = GameObject.FindGameObjectWithTag("Letter2");
            GameObject g3  = GameObject.FindGameObjectWithTag("Letter3");
            GameObject g4  = GameObject.FindGameObjectWithTag("Letter4");
            GameObject g5  = GameObject.FindGameObjectWithTag("Letter5");
            Vector3    pos = g1.transform.position;
            pos.y = 3;
            g1.transform.position = pos;
            pos   = g2.transform.position;
            pos.y = 1;
            g2.transform.position = pos;
            pos   = g3.transform.position;
            pos.y = 2;
            g3.transform.position = pos;
            pos   = g4.transform.position;
            pos.y = 0;
            g4.transform.position = pos;
            pos   = g5.transform.position;
            pos.y = 4;
            g5.transform.position = pos;

            t = GameObject.FindGameObjectWithTag("Letter" + letter_sort[selection][0]).GetComponentInChildren <Text>();

            if (tmp_correct.Count == 0)
            {
                var random_index = Random.Range(0, tmp_incorrect.Count);

                t.text = tmp_incorrect[random_index].ToString();
                tmp_incorrect.Remove(t.text[0]);
            }
            else
            {
                var random_index = Random.Range(0, tmp_correct.Count);

                t.text = tmp_correct[random_index].ToString();
                tmp_correct.Remove(t.text[0]);
            }



            t = GameObject.FindGameObjectWithTag("Letter" + letter_sort[selection][1]).GetComponentInChildren <Text>();
            if (tmp_correct.Count == 0)
            {
                var random_index = Random.Range(0, tmp_incorrect.Count);

                t.text = tmp_incorrect[random_index].ToString();
                tmp_incorrect.Remove(t.text[0]);
            }
            else
            {
                var random_index = Random.Range(0, tmp_correct.Count);

                t.text = tmp_correct[random_index].ToString();
                tmp_correct.Remove(t.text[0]);
            }

            t = GameObject.FindGameObjectWithTag("Letter" + letter_sort[selection][2]).GetComponentInChildren <Text>();
            {
                var random_index = Random.Range(0, tmp_incorrect.Count);

                t.text = tmp_incorrect[random_index].ToString();
                tmp_incorrect.Remove(t.text[0]);
            }

            t = GameObject.FindGameObjectWithTag("Letter" + letter_sort[selection][3]).GetComponentInChildren <Text>();
            {
                var random_index = Random.Range(0, tmp_incorrect.Count);

                t.text = tmp_incorrect[random_index].ToString();
                tmp_incorrect.Remove(t.text[0]);
            }

            /*
             * t = GameObject.FindGameObjectWithTag("Letter5").GetComponentInChildren<Text>();
             * {
             *  var random_index = Random.Range(0, tmp_incorrect.Count);
             *
             *  t.text = tmp_incorrect[random_index].ToString();
             *  tmp_incorrect.Remove(t.text[0]);
             * }
             */
        }
    }
Beispiel #26
0
 internal AttributeDescriptor(PropertyDescriptor property)
 {
     Debug.Assert(property != null, "property");
     this.property = property;
 }
        public void ConfigureAuth(IAppBuilder app)
        {
            app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);

            app.UseCookieAuthentication(new CookieAuthenticationOptions());

            app.UseOpenIdConnectAuthentication(
                new OpenIdConnectAuthenticationOptions {
                ClientId  = AADAppSettings.ClientId,
                Authority = AADAppSettings.Authority,

                TokenValidationParameters = new System.IdentityModel.Tokens.TokenValidationParameters {
                    // instead of using the default validation (validating against a single issuer value, as we do in line of business apps (single tenant apps)),
                    // we turn off validation
                    //
                    // NOTE:
                    // * In a multitenant scenario you can never validate against a fixed issuer string, as every tenant will send a different one.
                    // * If you don’t care about validating tenants, as is the case for apps giving access to 1st party resources, you just turn off validation.
                    // * If you do care about validating tenants, think of the case in which your app sells access to premium content and you want to limit access only to the tenant that paid a fee,
                    //       you still need to turn off the default validation but you do need to add logic that compares the incoming issuer to a list of tenants that paid you,
                    //       and block access if that’s not the case.
                    // * Refer to the following sample for a custom validation logic: https://github.com/AzureADSamples/WebApp-WebAPI-MultiTenant-OpenIdConnect-DotNet

                    ValidateIssuer = false
                },

                Notifications = new OpenIdConnectAuthenticationNotifications {
                    // If there is a code in the OpenID Connect response, redeem it for an access token and refresh token, and store those away.
                    AuthorizationCodeReceived = async context => {
                        var serviceCredential = new ClientCredential(AADAppSettings.ClientId, AADAppSettings.AppKey);

                        string tenantID       = context.AuthenticationTicket.Identity.FindFirst("http://schemas.microsoft.com/identity/claims/tenantid").Value;
                        string nameIdentifier = context.AuthenticationTicket.Identity.FindFirst(ClaimTypes.NameIdentifier).Value;

                        AuthenticationContext authContext = new AuthenticationContext(
                            string.Format("{0}/{1}", AADAppSettings.AuthorizationUri, tenantID),
                            new SimpleTokenCache(nameIdentifier)
                            );

                        // Get the access token for AAD Graph. Doing this will also initialize the token cache associated with the authentication context
                        // In theory, you could acquire token for any service your application has access to here so that you can initialize the token cache
                        AuthenticationResult result = await authContext.AcquireTokenByAuthorizationCodeAsync(
                            context.Code,
                            new Uri(context.Request.Uri.GetLeftPart(UriPartial.Path)),
                            serviceCredential,
                            AADAppSettings.SharePointResourceId
                            );

                        Debug.WriteLine("Auth result: {0}", result);
                    },

                    RedirectToIdentityProvider = (context) => {
                        // This ensures that the address used for sign in and sign out is picked up dynamically from the request
                        // this allows you to deploy your app (to Azure Web Sites, for example)without having to change settings
                        // Remember that the base URL of the address used here must be provisioned in Azure AD beforehand.
                        string appBaseUrl = context.Request.Scheme + "://" + context.Request.Host + context.Request.PathBase;
                        context.ProtocolMessage.RedirectUri           = appBaseUrl + "/Home/App";
                        context.ProtocolMessage.PostLogoutRedirectUri = appBaseUrl;

                        return(Task.FromResult(0));
                    },

                    AuthenticationFailed = (context) => {
                        // Suppress the exception
                        context.HandleResponse();

                        return(Task.FromResult(0));
                    }
                }
            });
        }
	void OnHealthChange(int updatedHealth){
		Debug.Log ("OnHealthChange called");
		HealthScore.text = updatedHealth.ToString ();
	}
Beispiel #29
0
 void ISerializedInterfaceExample.MyMethod()
 {
     Debug.Log("InterfaceImplementationA");
 }
Beispiel #30
0
 /// <summary>
 /// Callback to handle unsuccessful server interaction.
 /// </summary>
 /// <param name="response">Server response</param>
 private void EventSentErrorCallback(PlayFabError response)
 {
     Debug.LogWarning("Failed to send session data. Error: " + response.GenerateErrorReport());
 }
Beispiel #31
0
        /// <summary>
        /// Verifies Column Master Key Signature.
        /// </summary>
        internal static void VerifyColumnMasterKeySignature(string keyStoreName, string keyPath, string serverName, bool isEnclaveEnabled, byte[] CMKSignature)
        {
            bool isValidSignature = false;

            try
            {
                Debug.Assert(SqlConnection.ColumnEncryptionTrustedMasterKeyPaths != null,
                             @"SqlConnection.ColumnEncryptionTrustedMasterKeyPaths should not be null");

                if (CMKSignature == null || CMKSignature.Length == 0)
                {
                    throw SQL.ColumnMasterKeySignatureNotFound(keyPath);
                }

                // Check against the trusted key paths
                //
                // Get the List corresponding to the connected server
                IList <string> trustedKeyPaths;
                if (SqlConnection.ColumnEncryptionTrustedMasterKeyPaths.TryGetValue(serverName, out trustedKeyPaths))
                {
                    // If the list is null or is empty or if the keyPath doesn't exist in the trusted key paths, then throw an exception.
                    if ((trustedKeyPaths == null) || (trustedKeyPaths.Count() == 0) ||
                        // (trustedKeyPaths.Where(s => s.Equals(keyInfo.keyPath, StringComparison.InvariantCultureIgnoreCase)).Count() == 0)) {
                        (trustedKeyPaths.Any(
                             s => s.Equals(keyPath, StringComparison.InvariantCultureIgnoreCase)) == false))
                    {
                        // throw an exception since the key path is not in the trusted key paths list for this server
                        throw SQL.UntrustedKeyPath(keyPath, serverName);
                    }
                }

                // Key Not found, attempt to look up the provider and verify CMK Signature
                SqlColumnEncryptionKeyStoreProvider provider;
                if (!SqlConnection.TryGetColumnEncryptionKeyStoreProvider(keyStoreName, out provider))
                {
                    throw SQL.InvalidKeyStoreProviderName(keyStoreName,
                                                          SqlConnection.GetColumnEncryptionSystemKeyStoreProviders(),
                                                          SqlConnection.GetColumnEncryptionCustomKeyStoreProviders());
                }

                bool?signatureVerificationResult = ColumnMasterKeyMetadataSignatureVerificationCache.GetSignatureVerificationResult(keyStoreName, keyPath, isEnclaveEnabled, CMKSignature);

                if (signatureVerificationResult == null)
                {
                    // We will simply bubble up the exception from VerifyColumnMasterKeyMetadata function.
                    isValidSignature = provider.VerifyColumnMasterKeyMetadata(keyPath, isEnclaveEnabled,
                                                                              CMKSignature);

                    ColumnMasterKeyMetadataSignatureVerificationCache.AddSignatureVerificationResult(keyStoreName, keyPath, isEnclaveEnabled, CMKSignature, isValidSignature);
                }
                else
                {
                    isValidSignature = signatureVerificationResult.Value;
                }
            }
            catch (Exception e)
            {
                throw SQL.UnableToVerifyColumnMasterKeySignature(e);
            }

            if (!isValidSignature)
            {
                throw SQL.ColumnMasterKeySignatureVerificationFailed(keyPath);
            }
        }
Beispiel #32
0
 private void BtnDebugClick(object sender, EventArgs e)
 {
     var debug = new Debug();
     debug.Show();
 }
Beispiel #33
0
 public void OnBeginDrag(PointerEventData eventData)
 {
     offsetposition = transform.position - Input.mousePosition;
     Debug.Log("拖动开始");
 }
Beispiel #34
0
 /// <summary>
 /// Create a debuggable
 /// </summary>
 /// <param name="parent">Parent objet</param>
 /// <param name="name">The name of the debuggable</param>
 internal Debug(Debug parent, string name)
 {
     _parent = parent;
     Name = string.Format("{0}.{1}", GetParentName(parent), name.Replace(" ", string.Empty));
     DebugTable.Add(this);
 }
Beispiel #35
0
 static CluwneLib()
 {
     Video = new VideoSettings();
     Debug = new Debug();
 }
Beispiel #36
0
        private static void GenerateUriParameters(HelpPageApiModel apiModel, ModelDescriptionGenerator modelGenerator)
        {
            ApiDescription apiDescription = apiModel.ApiDescription;

            foreach (ApiParameterDescription apiParameter in apiDescription.ParameterDescriptions)
            {
                if (apiParameter.Source == ApiParameterSource.FromUri)
                {
                    HttpParameterDescriptor parameterDescriptor        = apiParameter.ParameterDescriptor;
                    Type                        parameterType          = null;
                    ModelDescription            typeDescription        = null;
                    ComplexTypeModelDescription complexTypeDescription = null;
                    if (parameterDescriptor != null)
                    {
                        parameterType          = parameterDescriptor.ParameterType;
                        typeDescription        = modelGenerator.GetOrCreateModelDescription(parameterType);
                        complexTypeDescription = typeDescription as ComplexTypeModelDescription;
                    }

                    // Example:
                    // [TypeConverter(typeof(PointConverter))]
                    // public class Point
                    // {
                    //     public Point(int x, int y)
                    //     {
                    //         X = x;
                    //         Y = y;
                    //     }
                    //     public int X { get; set; }
                    //     public int Y { get; set; }
                    // }
                    // Class Point is bindable with a TypeConverter, so Point will be added to UriParameters collection.
                    //
                    // public class Point
                    // {
                    //     public int X { get; set; }
                    //     public int Y { get; set; }
                    // }
                    // Regular complex class Point will have properties X and Y added to UriParameters collection.
                    if (complexTypeDescription != null &&
                        !IsBindableWithTypeConverter(parameterType))
                    {
                        foreach (ParameterDescription uriParameter in complexTypeDescription.Properties)
                        {
                            apiModel.UriParameters.Add(uriParameter);
                        }
                    }
                    else if (parameterDescriptor != null)
                    {
                        ParameterDescription uriParameter =
                            AddParameterDescription(apiModel, apiParameter, typeDescription);

                        if (!parameterDescriptor.IsOptional)
                        {
                            uriParameter.Annotations.Add(new ParameterAnnotation()
                            {
                                Documentation = "Required"
                            });
                        }

                        object defaultValue = parameterDescriptor.DefaultValue;
                        if (defaultValue != null)
                        {
                            uriParameter.Annotations.Add(new ParameterAnnotation()
                            {
                                Documentation = "Default value is " + Convert.ToString(defaultValue, CultureInfo.InvariantCulture)
                            });
                        }
                    }
                    else
                    {
                        Debug.Assert(parameterDescriptor == null);

                        // If parameterDescriptor is null, this is an undeclared route parameter which only occurs
                        // when source is FromUri. Ignored in request model and among resource parameters but listed
                        // as a simple string here.
                        ModelDescription modelDescription = modelGenerator.GetOrCreateModelDescription(typeof(string));
                        AddParameterDescription(apiModel, apiParameter, modelDescription);
                    }
                }
            }
        }
Beispiel #37
0
    void Start()
    {
        // GetComponent<AudioSource>().playOnAwake = false;
        // GetComponent<AudioSource>().clip = bubblepop;

        AnalyticsEvent.Custom("Level", new Dictionary <string, object>
        {
            { "level", level },
            { "word", actual_word }
        });



        Analytics.CustomEvent("Level", new Dictionary <string, object>
        {
            { "level", level },
            { "word", actual_word }
        });
        Firebase.Analytics.FirebaseAnalytics.LogEvent("word", "string", actual_word);

        if (gameObject.tag == "restart_Button" || gameObject.tag == "exit_button")
        {
            return;
        }
        Random.seed = System.DateTime.Now.Millisecond;
        if (letter_sort.Count == 0)
        {
            letter_sort.Add(new int[] { 1, 2, 3, 4 });
            letter_sort.Add(new int[] { 2, 1, 3, 4 });
            letter_sort.Add(new int[] { 3, 1, 2, 4 });
            letter_sort.Add(new int[] { 1, 3, 2, 4 });
            letter_sort.Add(new int[] { 2, 3, 1, 4 });
            letter_sort.Add(new int[] { 3, 2, 1, 4 });
            letter_sort.Add(new int[] { 3, 2, 4, 1 });
            letter_sort.Add(new int[] { 2, 3, 4, 1 });
            letter_sort.Add(new int[] { 4, 3, 2, 1 });
            letter_sort.Add(new int[] { 3, 4, 2, 1 });
            letter_sort.Add(new int[] { 2, 4, 3, 1 });
            letter_sort.Add(new int[] { 4, 2, 3, 1 });
            letter_sort.Add(new int[] { 4, 1, 3, 2 });
            letter_sort.Add(new int[] { 1, 4, 3, 2 });
            letter_sort.Add(new int[] { 3, 4, 1, 2 });
            letter_sort.Add(new int[] { 4, 3, 1, 2 });
            letter_sort.Add(new int[] { 1, 3, 4, 2 });
            letter_sort.Add(new int[] { 3, 1, 4, 2 });
            letter_sort.Add(new int[] { 2, 1, 4, 3 });
            letter_sort.Add(new int[] { 1, 2, 4, 3 });
            letter_sort.Add(new int[] { 4, 2, 1, 3 });
            letter_sort.Add(new int[] { 2, 4, 1, 3 });
            letter_sort.Add(new int[] { 1, 4, 2, 3 });
            letter_sort.Add(new int[] { 4, 1, 2, 3 });
        }
        GameObject.FindGameObjectWithTag("level").GetComponent <Text>().text         = "Level : " + level;
        GameObject.FindGameObjectWithTag("hint_button").GetComponent <Image>().color = Color.white;
        Debug.Log("1");
        //hp.paused = false;
        h1 = GameObject.FindGameObjectWithTag("heart1");
        h2 = GameObject.FindGameObjectWithTag("heart2");
        h3 = GameObject.FindGameObjectWithTag("heart3");
        // game object reference put using unity ui only
        //Debug.Log("2");
        if (hp == null)
        {
            hp = GameObject.FindGameObjectWithTag("hint_button").GetComponent <hints_panel>();
        }
        //gameObject.SetActive(true);


        if (remaining == null)
        {
            level      = EasyScript.temp_level;
            levelTimer = 0.0f;
            Debug.Log("21");
            Incorrect           = new List <char>();
            Correct             = new List <char>();
            CorrectandIncorrect = new List <char>();
            guessed_wordset     = new HashSet <string>();
            //List<Dictionary<string, object>> data = CSVReader.Read("data");
            string level_status = "";
            if (level >= 1 && level <= 5)
            {
                level_status = "Easy";
            }
            else if (level >= 6 && level <= 12)
            {
                level_status = "Medium";
            }
            else
            {
                level_status = "Hard";
                if (level > 21)
                {
                    level        = 1;
                    level_status = "Easy";
                }
            }

            List <Dictionary <string, object> > data = CSVReader.Read(level_status);
            var random_index_1 = Random.Range(0, data.Count);
            //Debug.Log("3");

            actual_word = data[random_index_1]["word"].ToString();
            while (guessed_wordset.Contains(actual_word.ToUpper()))
            {
                random_index_1 = Random.Range(0, data.Count);
                actual_word    = data[random_index_1]["word"].ToString();
            }
            guessed_wordset.Add(actual_word.ToUpper());
            Debug.Log(guessed_wordset);
            hint_1   = data[random_index_1]["Hint 1"].ToString();
            hint_2   = data[random_index_1]["Hint 2"].ToString();
            hint_3   = data[random_index_1]["Hint 3"].ToString();
            category = data[random_index_1]["Category"].ToString();
            category = string.Join(" ", category.Split(' ').Select(i => i.Substring(0, 1).ToUpper() + i.Substring(1).ToLower()).ToArray());;

            //Debug.Log("4");
            Text cat = GameObject.FindGameObjectWithTag("category").GetComponent <Text>();
            cat.text     = "Category : " + (category);
            word1        = actual_word.ToUpper();
            word_formed  = new string(word1.Distinct().ToArray());
            word_formed1 = word1;
            word_length  = word_formed.Length;
            word_length1 = word_formed1.Length;
            char_arr     = word_formed.ToCharArray();
            remaining    = new string(allCharacters.Except(char_arr).ToArray()).ToCharArray();
            Debug.Log("5");
            //Comment an entire block
            for (int j = 0; j < word_length + 3; j++)
            {
                if (j >= word_length)
                {
                    var random_index = Random.Range(0, remaining.Length);
                    CorrectandIncorrect.Add(remaining[random_index]);
                }
                else
                {
                    CorrectandIncorrect.Add(char_arr[j]);
                }
            }
            //Random index selected to be filled
            var random_letter_selected = Random.Range(0, word_length);
            var random_letter          = char_arr[random_letter_selected];
            //Till here
            for (int j = 0; j < word_length; j++)
            {
                if (word1[j] != random_letter)
                {
                    Correct.Add(char_arr[j]);
                }
            }
            for (int j = 0; j < remaining.Length; j++)
            {
                Incorrect.Add(remaining[j]);
            }

            Debug.Log(new string(remaining.ToArray()));


            string s           = "";
            int    totalLength = 0;
            while (totalLength != word_length1)
            {
                Debug.Log("Step 1");
                if (word1[totalLength] != random_letter)
                {
                    s += "_ ";
                }
                else
                {
                    s += random_letter + " ";
                }
                totalLength += 1;
            }
            Debug.Log("Step 2");
            wordCreated.text = s;
            // i++;
            Debug.Log(new string(Incorrect.ToArray()));
            Debug.Log(new string(Correct.ToArray()));

            //else if (i == char_arr.Length)
            // else if (i == CorrectandIncorrect.Count)

            updateLetters();
            if (hp == null)
            {
                hp = GameObject.FindGameObjectWithTag("hint_button").GetComponent <hints_panel>();
            }
            hp.OpenPanelInit("1. " + hint_1);
        }


        //Text t = gameObject.GetComponentInChildren<Text>();
        //Debug.Log(t.text);
        //if (i < char_arr.Length)
        Debug.Log(CorrectandIncorrect.Count);
        //if (i < CorrectandIncorrect.Count)
        {
            if (hp == null)
            {
                hp = GameObject.FindGameObjectWithTag("hint_button").GetComponent <hints_panel>();
            }
        }
        /* load previous save data */
        if (gameObject.tag == "Letter1") // because I want only one object to do file IO
        {
            loadData();
            //level = previousBestLevel +1;
            /* loads from previous best */
            //if(level >=21)
            {
                //    previousBestLevel = 1;
                //    level = 1;
            }
        }
        /* end */
    }
 public void OnClick()
 {
     Debug.Log("Quitting application");
     Application.Quit();
 }
Beispiel #39
0
    private void OnCollisionEnter2D(Collision2D collision)
    {
        Debug.Log(word_formed);
        //if (collision.gameObject.tag == "Letter" ){
        //  GetComponent<AudioSource>().Play();
        // }


        if (collision.gameObject.tag == "bullet" && gameObject.tag == "Letter5")
        {
            GameObject.FindGameObjectWithTag("conf").GetComponent <ParticleSystem>().Play();
            collision.gameObject.SetActive(false);
            gameObject.SetActive(false);
            Invoke("ResetBall", 0.2f);
            Debug.Log("hit heart");
            //Hearts collected by user
            no_of_hearts_collected += 1;

            //yield return StartCoroutine(FadeEffect.FadeCanvas(GameObject.FindGameObjectWithTag("extralife").GetComponent<CanvasGroup>(), 0f, 1f, 1f));
            //StartCoroutine(FadeEffect.FadeCanvas(GameObject.FindGameObjectWithTag("extralife").GetComponent<CanvasGroup>(), 1f, 0f, 1f));
            if (health == 3)
            {
                GameObject.FindGameObjectWithTag("extrahint").GetComponent <CanvasGroup>().alpha = 1f;

                Text t1 = GameObject.FindGameObjectWithTag("Letter1").GetComponentInChildren <Text>();
                Text t2 = GameObject.FindGameObjectWithTag("Letter2").GetComponentInChildren <Text>();
                Text t3 = GameObject.FindGameObjectWithTag("Letter3").GetComponentInChildren <Text>();
                Text t4 = GameObject.FindGameObjectWithTag("Letter4").GetComponentInChildren <Text>();
                // To highight the bubble
                Color newCol;
                if (ColorUtility.TryParseHtmlString("#F1FF5D", out newCol))
                {
                    if (word1.Contains(t1.text[0]))
                    {
                        GameObject.FindGameObjectWithTag("Letter1").GetComponent <SpriteRenderer>().color = newCol;
                    }
                    else if (word1.Contains(t2.text[0]))
                    {
                        GameObject.FindGameObjectWithTag("Letter2").GetComponent <SpriteRenderer>().color = newCol;
                    }
                    else if (word1.Contains(t3.text[0]))
                    {
                        GameObject.FindGameObjectWithTag("Letter3").GetComponent <SpriteRenderer>().color = newCol;
                    }
                    else if (word1.Contains(t4.text[0]))
                    {
                        GameObject.FindGameObjectWithTag("Letter4").GetComponent <SpriteRenderer>().color = newCol;
                    }
                }

                Debug.Log("health=" + health);
            }
            else if (health <= 2)
            {
                GameObject.FindGameObjectWithTag("extralife").GetComponent <CanvasGroup>().alpha = 1f;
                // increase health
                health++;
                if (health == 3)
                {
                    Debug.Log("health=" + health);
                    //h1.SetActive(true);
                    h1.GetComponentInChildren <SpriteRenderer>().color = opaque;
                }
                else if (health == 2)
                {
                    Debug.Log("health=" + health);
                    //h2.SetActive(true);
                    h2.GetComponentInChildren <SpriteRenderer>().color = opaque;
                }
            }
            timerStart    = levelTimer;
            extra_showing = true;
        }
        else if (collision.gameObject.tag == "bullet")
        {
            //AA93DD
            //GameObject g = Instantiate(collision.gameObject, new Vector3(0,0), transform.rotation);
            collision.gameObject.SetActive(false);
            gameObject.GetComponentInChildren <SpriteRenderer>().color = Color.white;
            GameObject.FindGameObjectWithTag("Letter1").GetComponent <SpriteRenderer>().color = Color.white;
            GameObject.FindGameObjectWithTag("Letter2").GetComponent <SpriteRenderer>().color = Color.white;
            GameObject.FindGameObjectWithTag("Letter3").GetComponent <SpriteRenderer>().color = Color.white;
            GameObject.FindGameObjectWithTag("Letter4").GetComponent <SpriteRenderer>().color = Color.white;

            gameObject.SetActive(false);
            Invoke("ResetBall", 0.2f);
            Text t = gameObject.GetComponentInChildren <Text>();
            Debug.Log(new string(Incorrect.ToArray()));
            Debug.Log(new string(Correct.ToArray()));

            if (word_formed1.Contains(t.text[0])) //Condition when it is a correct character
            {
                var foundIndexes = new List <int>();
                bubble_flag = 0;

                for (int j = word_formed1.IndexOf(t.text[0]); j > -1; j = word_formed1.IndexOf(t.text[0], j + 1))
                {
                    // for loop end when i=-1 ('a' not found)
                    foundIndexes.Add(j);
                }
                char[] x = wordCreated.text.ToCharArray();
                Debug.Log(x.ToString());
                for (int j = 0; j < foundIndexes.Count; j++)
                {
                    x[foundIndexes[j] * 2] = t.text[0];
                }

                Debug.Log("Before collision" + new string(CorrectandIncorrect.ToArray()));
                CorrectandIncorrect.Remove(t.text[0]);
                Debug.Log("After collision" + new string(CorrectandIncorrect.ToArray()));
                int random_index;
                do
                {
                    random_index = Random.Range(0, remaining.Length);
                }while (CorrectandIncorrect.Contains(remaining[random_index]));
                CorrectandIncorrect.Add(remaining[random_index]);

                wordCreated.text = new string(x);
                if (wordCreated.text.Replace(" ", "").Equals(word_formed1))
                {
                    Text t11 = gameover.GetComponentInChildren <Text>();
                    t11.text = "Congrats!";
                    Text t12 = restart_Button.GetComponentInChildren <Text>();
                    t12.text = "Next";
                    //\n Completed Level "+ level+" ! \n Word: "+ word_formed1+"\n";

                    level += 1;
                    /* save game state */
                    saveData();
                    /* finished saving */
                    gameover.SetActive(true);
                    setReset(true);
                    GameObject.FindGameObjectWithTag("confetti").GetComponent <ParticleSystem>().Play();
                    Debug.Log("Level completed " + level);
                    Analytics.CustomEvent("Level_Health_Attempts", new Dictionary <string, object>
                    {
                        { "level " + level, health },
                        { "Attempts for " + (level), attempts_for_current_level }
                    });
                    Debug.Log("level " + level + health);
                    Debug.Log("Attempts for " + (level) + attempts_for_current_level);
                    //if(level > previousBestLevel)
                    //{
                    //    previousBestLevel = level;
                    //}
                    if (level == 6)
                    {
                        // //Display all the Easy levels are over
                        // hp = null;
                        // remaining = null;
                        //setReset(false);
                        // //Display a canvas with showing all easy levels completed
                        // SceneManager.LoadScene(sceneName: "LevelScene");
                    }
                    else if (level == 13)
                    {
                        //Display all the Easy levels are over
                        // hp = null;
                        // remaining = null;
                        // setReset(false);
                        // //Display a canvas with showing all medium levels completed

                        // SceneManager.LoadScene(sceneName: "LevelScene");
                    }
                    /* if level is greater than 20 go back to 1 */
                    else if (level >= 21)
                    {
                        // level = 1;
                    }
                    else
                    {
                        restart_Button.SetActive(true);
                    }

                    /*
                     * for analytics use
                     */

                    //Analytics.CustomEvent("Attempts", new Dictionary<string, object>
                    //  {
                    //    { "Attempts for "+(level-1), attempts_for_current_level}

                    //  });
                    attempts_for_current_level = 1; // reset the attempts count to 1


                    /* analytics ends */
                    //hp.gameObject.SetActive(false);
                    //collision.gameObject.SetActive(false);
                    gameObject.SetActive(true);
                    //TODO
                    bullet = collision.gameObject;

                    reset_canvas.SetActive(true);
                    exit_button.SetActive(true);
                    return;
                }
                else
                {
                    GameObject.FindGameObjectWithTag("conf").GetComponent <ParticleSystem>().Play();
                }
            }


            else
            {
                /** decrement health **/
                health--;
                //new_hint = 1;
                if (health == 2)
                {
                    h1.GetComponentInChildren <SpriteRenderer>().color = trans;
                    //h1.SetActive(false);
                    GameObject.FindGameObjectWithTag("hint_button").GetComponent <Image>().color = Color.red;
                }

                else if (health == 1)
                {
                    h2.GetComponentInChildren <SpriteRenderer>().color = trans;
                    //h2.SetActive(false);
                    GameObject.FindGameObjectWithTag("hint_button").GetComponent <Image>().color = Color.green;
                }
                else if (health == 0)
                {
                    Text t11 = gameover.GetComponentInChildren <Text>();
                    Debug.Log(word1);

                    /* save data */
                    saveData();

                    t11.text = "Game Over!\nCorrect Word: " + actual_word.ToUpper();
                    Text t12 = restart_Button.GetComponentInChildren <Text>();
                    t12.text = "Restart";
                    attempts_for_current_level += 1; //increment number of attempts
                    gameover.SetActive(true);
                    setReset(true);
                    //hp.gameObject.SetActive(false);
                    collision.gameObject.SetActive(false);
                    gameObject.SetActive(true);
                    h3.GetComponentInChildren <SpriteRenderer>().color = trans;
                    //h3.SetActive(false);
                    //TODO
                    restart_Button.SetActive(true);
                    exit_button.SetActive(true);
                    reset_canvas.SetActive(true);
                    Analytics.CustomEvent("gameOver", new Dictionary <string, object>
                    {
                        { "no_of_hearts_collected_by_user:"******"no_of_hearts_collected_by_user:"******"time played:" + levelTimer);
                    AnalyticsEvent.Custom("gameOver", new Dictionary <string, object>
                    {
                        { "no_of_hearts_collected_by_user:"******"no_of_hearts_collected_by_user:"******"SideWall")
        {
            direction *= -1;
        }
    }
Beispiel #40
0
    //dentro questo metodo avviene la gestione dei checkpoint: appena uno viene colpito si disattiva e viene subito attivato il successivo
    private void OnTriggerEnter(Collider collider)
    {
        switch (collider.gameObject.name)
        {
        case "Checkpoint01":
            if (checkTimeBonus01 == true)
            {
                Checkpoint01.tag     = "Untagged";
                Checkpoint02.tag     = "active_checkpoint";
                Checkpoint01.enabled = false;
                Checkpoint02.enabled = true;
                GameObject.FindGameObjectWithTag("Car").SendMessage("updateTime");                //questo script "comunica" con quello del timer, lanciando il metodo del timer "updateTime" che aggiunge i secondi bonus ottenuti dal checkpoint
                checkTimeBonus01 = false;
                checkTimeBonus02 = true;
                Debug.Log(collider.gameObject.name);
                passedCheckpoints++;
                coordinates.SetX(GameObject.FindGameObjectWithTag("Car").transform.position.x);                 //a ogni chekpoint vengono memorizzate le coordinate attuali della macchina
                coordinates.SetY(GameObject.FindGameObjectWithTag("Car").transform.position.y);
                coordinates.SetZ(GameObject.FindGameObjectWithTag("Car").transform.position.z);
                //actualTime = PlayerPrefs.GetInt ("actualTime");

                //Debug.Log (coordinates.GetX () + " " + coordinates.GetY () + " " + coordinates.GetZ ());
            }
            break;

        case "Checkpoint02":
            if (checkTimeBonus02 == true)
            {
                Checkpoint02.tag     = "Untagged";
                Checkpoint03.tag     = "active_checkpoint";
                Checkpoint02.enabled = false;
                Checkpoint03.enabled = true;
                GameObject.FindGameObjectWithTag("Car").SendMessage("updateTime");
                checkTimeBonus02 = false;
                checkTimeBonus03 = true;
                Debug.Log(collider.gameObject.name);
                passedCheckpoints++;
                coordinates.SetX(GameObject.FindGameObjectWithTag("Car").transform.position.x);
                coordinates.SetY(GameObject.FindGameObjectWithTag("Car").transform.position.y);
                coordinates.SetZ(GameObject.FindGameObjectWithTag("Car").transform.position.z);
            }
            break;

        case "Checkpoint03":
            if (checkTimeBonus03 == true)
            {
                Checkpoint03.tag     = "Untagged";
                Checkpoint04.tag     = "active_checkpoint";
                Checkpoint03.enabled = false;
                Checkpoint04.enabled = true;
                GameObject.FindGameObjectWithTag("Car").SendMessage("updateTime");
                checkTimeBonus03 = false;
                checkTimeBonus04 = true;
                Debug.Log(collider.gameObject.name);
                passedCheckpoints++;
                coordinates.SetX(GameObject.FindGameObjectWithTag("Car").transform.position.x);
                coordinates.SetY(GameObject.FindGameObjectWithTag("Car").transform.position.y);
                coordinates.SetZ(GameObject.FindGameObjectWithTag("Car").transform.position.z);
            }
            break;

        case "Checkpoint04":
            if (checkTimeBonus04 == true)
            {
                Checkpoint04.tag     = "Untagged";
                Checkpoint05.tag     = "active_checkpoint";
                Checkpoint04.enabled = false;
                Checkpoint05.enabled = true;
                GameObject.FindGameObjectWithTag("Car").SendMessage("updateTime");
                checkTimeBonus04 = false;
                checkTimeBonus05 = true;
                Debug.Log(collider.gameObject.name);
                passedCheckpoints++;
                coordinates.SetX(GameObject.FindGameObjectWithTag("Car").transform.position.x);
                coordinates.SetY(GameObject.FindGameObjectWithTag("Car").transform.position.y);
                coordinates.SetZ(GameObject.FindGameObjectWithTag("Car").transform.position.z);
            }
            break;

        case "Checkpoint05":
            if (checkTimeBonus05 == true)
            {
                Checkpoint05.tag     = "Untagged";
                Checkpoint06.tag     = "active_checkpoint";
                Checkpoint05.enabled = false;
                Checkpoint06.enabled = true;
                GameObject.FindGameObjectWithTag("Car").SendMessage("updateTime");
                checkTimeBonus05 = false;
                checkTimeBonus06 = true;
                Debug.Log(collider.gameObject.name);
                passedCheckpoints++;
                coordinates.SetX(GameObject.FindGameObjectWithTag("Car").transform.position.x);
                coordinates.SetY(GameObject.FindGameObjectWithTag("Car").transform.position.y);
                coordinates.SetZ(GameObject.FindGameObjectWithTag("Car").transform.position.z);
            }
            break;

        case "Checkpoint06":
            if (checkTimeBonus06 == true)
            {
                Checkpoint06.tag     = "Untagged";
                Checkpoint07.tag     = "active_checkpoint";
                Checkpoint06.enabled = false;
                Checkpoint07.enabled = true;
                GameObject.FindGameObjectWithTag("Car").SendMessage("updateTime");
                checkTimeBonus06 = false;
                checkTimeBonus07 = true;
                Debug.Log(collider.gameObject.name);
                passedCheckpoints++;
                coordinates.SetX(GameObject.FindGameObjectWithTag("Car").transform.position.x);
                coordinates.SetY(GameObject.FindGameObjectWithTag("Car").transform.position.y);
                coordinates.SetZ(GameObject.FindGameObjectWithTag("Car").transform.position.z);
            }
            break;

        case "Checkpoint07":
            if (checkTimeBonus07 == true)
            {
                Checkpoint07.enabled = false;
                GameObject.FindGameObjectWithTag("Car").SendMessage("updateTime");
                checkTimeBonus07 = false;
                Debug.Log(collider.gameObject.name);
                passedCheckpoints++;
            }
            break;
        }
    }
        private List<MeshData> CreateMeshListFromTransforms(ref List<Transform> meshTransforms)
        {
            List<MeshData> meshList = new List<MeshData>();
            List<Transform> validTransformList = new List<Transform>();

            if (part.Modules.Contains<KerbalEVA>() || part.Modules.Contains<FlagSite>())
            {
                Debug.Log("Adding vox box to Kerbal / Flag");
                meshList.Add(CreateBoxMeshForKerbalEVA());
                validTransformList.Add(part.partTransform);
                meshTransforms = validTransformList;
                return meshList;
            } 
            
            Bounds rendererBounds = this.part.GetPartOverallMeshBoundsInBasis(part.partTransform.worldToLocalMatrix);
            Bounds colliderBounds = this.part.GetPartColliderBoundsInBasis(part.partTransform.worldToLocalMatrix);

            bool cantUseColliders = true;
            bool isFairing = part.Modules.Contains<ModuleProceduralFairing>() || part.Modules.Contains("ProceduralFairingSide");
            bool isDrill = part.Modules.Contains<ModuleAsteroidDrill>() || part.Modules.Contains<ModuleResourceHarvester>();

            //Voxelize colliders
            if ((forceUseColliders || isFairing || isDrill || (rendererBounds.size.x * rendererBounds.size.z < colliderBounds.size.x * colliderBounds.size.z * 1.6f && rendererBounds.size.y < colliderBounds.size.y * 1.2f && (rendererBounds.center - colliderBounds.center).magnitude < 0.3f)) && !forceUseMeshes)
            {
                foreach (Transform t in meshTransforms)
                {
                    MeshData md = GetColliderMeshData(t);
                    if (md == null)
                        continue;

                    meshList.Add(md);
                    validTransformList.Add(t);
                    cantUseColliders = false;
                }
            }


            if (part.Modules.Contains<ModuleJettison>())
            {
                List<ModuleJettison> jettisons = part.Modules.GetModules<ModuleJettison>();
                HashSet<Transform> jettisonTransforms = new HashSet<Transform>();
                for(int i = 0; i < jettisons.Count; i++)
                {
                    ModuleJettison j = jettisons[i];
                    if (j.jettisonTransform == null)
                        continue;

                    jettisonTransforms.Add(j.jettisonTransform);
                    if (j.isJettisoned)
                        continue;
                    
                    Transform t = j.jettisonTransform;
                    if (t.gameObject.activeInHierarchy == false)
                        continue;
                    
                    MeshData md = GetVisibleMeshData(t, false);
                    if (md == null)
                        continue;

                    meshList.Add(md);
                    validTransformList.Add(t);
                }

                //Voxelize Everything
                if ((cantUseColliders || forceUseMeshes || isFairing) && !isDrill)       //in this case, voxelize _everything_
                {
                    foreach (Transform t in meshTransforms)
                    {
                        if (jettisonTransforms.Contains(t))
                            continue;
                        MeshData md = GetVisibleMeshData(t, false);
                        if (md == null)
                            continue;

                        meshList.Add(md);
                        validTransformList.Add(t);
                    }
                }
            }
            else
            {
                //Voxelize Everything
                if ((cantUseColliders || forceUseMeshes || isFairing) && !isDrill)       //in this case, voxelize _everything_
                {
                    foreach (Transform t in meshTransforms)
                    {
                        MeshData md = GetVisibleMeshData(t, false);
                        if (md == null)
                            continue;

                        meshList.Add(md);
                        validTransformList.Add(t);
                    }
                }
            }
            meshTransforms = validTransformList;
            return meshList;
        }
Beispiel #42
0
 private void OnTriggerEnter(Collider other)
 {
     Debug.Log(other + " entered collision area");
     SceneManager.LoadScene(2);
 }
Beispiel #43
0
 /// <summary>
 /// Register the pipe with this socket.
 /// </summary>
 /// <param name="pipe">the Pipe to attach</param>
 /// <param name="icanhasall">not used</param>
 protected override void XAttachPipe(Pipe pipe, bool icanhasall)
 {
     Debug.Assert(pipe != null);
     m_fairQueueing.Attach(pipe);
     m_loadBalancer.Attach(pipe);
 }
Beispiel #44
0
 public void OnEndDrag(PointerEventData eventData)
 {
     Debug.Log("拖动结束");
 }
Beispiel #45
0
        internal override EmbeddedMethod EmbedMethod(
            EmbeddedType type,
            MethodSymbol method,
            CSharpSyntaxNode syntaxNodeOpt,
            DiagnosticBag diagnostics)
        {
            Debug.Assert(method.IsDefinition);
            Debug.Assert(!method.IsDefaultValueTypeConstructor());

            EmbeddedMethod embedded = new EmbeddedMethod(type, method);
            EmbeddedMethod cached   = EmbeddedMethodsMap.GetOrAdd(method, embedded);

            if (embedded != cached)
            {
                return(cached);
            }

            // We do not expect this method to be called on a different thread once GetTypes is called.
            // Therefore, the following check can be as simple as:
            Debug.Assert(!IsFrozen, "Set of embedded methods is frozen.");

            // Embed types referenced by this method declaration.
            EmbedReferences(embedded, syntaxNodeOpt, diagnostics);

            switch (type.UnderlyingNamedType.TypeKind)
            {
            case TypeKind.Struct:
            case TypeKind.Enum:
                // ERRID.ERR_InvalidStructMemberNoPIA1/ERR_InteropStructContainsMethods
                ReportNotEmbeddableSymbol(ErrorCode.ERR_InteropStructContainsMethods, type.UnderlyingNamedType, syntaxNodeOpt, diagnostics, this);
                break;

            default:
                if (Cci.Extensions.HasBody(embedded))
                {
                    // ERRID.ERR_InteropMethodWithBody1/ERR_InteropMethodWithBody
                    Error(diagnostics, ErrorCode.ERR_InteropMethodWithBody, syntaxNodeOpt, method.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat));
                }
                break;
            }

            // If this proc happens to belong to a property/event, we should include the property/event as well.
            Symbol propertyOrEvent = method.AssociatedSymbol;

            if ((object)propertyOrEvent != null)
            {
                switch (propertyOrEvent.Kind)
                {
                case SymbolKind.Property:
                    EmbedProperty(type, (PropertySymbol)propertyOrEvent, syntaxNodeOpt, diagnostics);
                    break;

                case SymbolKind.Event:
                    EmbedEvent(type, (EventSymbol)propertyOrEvent, syntaxNodeOpt, diagnostics, isUsedForComAwareEventBinding: false);
                    break;

                default:
                    throw ExceptionUtilities.UnexpectedValue(propertyOrEvent.Kind);
                }
            }

            return(embedded);
        }
Beispiel #46
0
        private void AddOneArgTypeHelper(Type clsArgument, Type[]?requiredCustomModifiers, Type[]?optionalCustomModifiers)
        {
            // This function will not increase the argument count. It only fills in bytes
            // in the signature based on clsArgument. This helper is called for return type.

            Debug.Assert(clsArgument != null);

            if (optionalCustomModifiers != null)
            {
                for (int i = 0; i < optionalCustomModifiers.Length; i++)
                {
                    Type t = optionalCustomModifiers[i];

                    if (t == null)
                    {
                        throw new ArgumentNullException(nameof(optionalCustomModifiers));
                    }

                    if (t.HasElementType)
                    {
                        throw new ArgumentException(SR.Argument_ArraysInvalid, nameof(optionalCustomModifiers));
                    }

                    if (t.ContainsGenericParameters)
                    {
                        throw new ArgumentException(SR.Argument_GenericsInvalid, nameof(optionalCustomModifiers));
                    }

                    AddElementType(CorElementType.ELEMENT_TYPE_CMOD_OPT);

                    int token = m_module !.GetTypeToken(t).Token;
                    Debug.Assert(!MetadataToken.IsNullToken(token));
                    AddToken(token);
                }
            }

            if (requiredCustomModifiers != null)
            {
                for (int i = 0; i < requiredCustomModifiers.Length; i++)
                {
                    Type t = requiredCustomModifiers[i];

                    if (t == null)
                    {
                        throw new ArgumentNullException(nameof(requiredCustomModifiers));
                    }

                    if (t.HasElementType)
                    {
                        throw new ArgumentException(SR.Argument_ArraysInvalid, nameof(requiredCustomModifiers));
                    }

                    if (t.ContainsGenericParameters)
                    {
                        throw new ArgumentException(SR.Argument_GenericsInvalid, nameof(requiredCustomModifiers));
                    }

                    AddElementType(CorElementType.ELEMENT_TYPE_CMOD_REQD);

                    int token = m_module !.GetTypeToken(t).Token;
                    Debug.Assert(!MetadataToken.IsNullToken(token));
                    AddToken(token);
                }
            }

            AddOneArgTypeHelper(clsArgument);
        }
Beispiel #47
0
	// Update is called once per frame
	void Update ()
    {

        if (platformerController.collisionInfo.above || platformerController.collisionInfo.below)
        {
            velocity.y = 0;
        }
        
        if (shouldMove)
        {
            bounds = GetComponent<Collider2D>().bounds;
            //if we are currently moving right
            if(facingRight)
            {

                if (platformerController.collisionInfo.right == false)
                {

                    //check if we will fall more than x blocks
                    Debug.DrawRay(new Vector2(bounds.max.x, bounds.min.y), Vector2.down * 1.1f, Color.red);
                    RaycastHit2D hit = Physics2D.Raycast(new Vector2(bounds.max.x, bounds.min.y), Vector2.down, 1.1f, ground);

                    //hit ground
                    if (hit.collider != null)
                    {
                        //Debug.Log(string.Format("Hit Object: {0}", hit.collider.gameObject));

                        //Debug.Log(string.Format("Hit distance: {0}", bounds.max.x, bounds.min.y));
                        if (hit.distance > 1)
                        {
                            SetDirection(false);
                            //Debug.Log(string.Format("Flip | Speed: {0}", speed));
                            Flip();
                        }
                    }
                    else
                    {
                        SetDirection(false);
                        //Debug.Log(string.Format("Flip | Speed: {0}", speed));
                        Flip();
                    }
                }
                else
                {
                    SetDirection(false);
                    //Debug.Log(string.Format("Flip | Speed: {0}", speed));
                    Flip();
                }
            }

            else
            {
                if (platformerController.collisionInfo.left == false)
                {
                    //check if we will fall more than x blocks
                    Debug.DrawRay(new Vector2(bounds.min.x, bounds.min.y), Vector2.down * 1.1f, Color.red);
                    RaycastHit2D hit = Physics2D.Raycast(new Vector2(bounds.min.x, bounds.min.y), Vector2.down, 1.1f, ground);
                    //hit ground
                    if (hit.collider != null)
                    {

                        //Debug.Log(string.Format("Hit Object: {0}", hit.collider.gameObject));
                        Debug.Log(string.Format("Hit distance: {0}", bounds.min.x, bounds.min.y));
                        if (hit.distance > 1)
                        {
                            SetDirection(true);
                            Debug.Log(string.Format("Flip | Speed: {0}", speed));
                            Flip();

                        }

                    }
                    else
                    {
                        SetDirection(true);
                        Debug.Log(string.Format("Flip | Speed: {0}", speed));
                        Flip();

                    }

                }
                else
                {
                    SetDirection(true);
                    Debug.Log(string.Format("Flip | Speed: {0}", speed));
                    Flip();
                }
            }

        Vector2 moveInput = new Vector2(speed, 0);
        velocity.x = moveInput.x;
        }
        velocity.y += gravity * Time.deltaTime;
        platformerController.Move(velocity * Time.deltaTime);        

    }
Beispiel #48
0
    /// <summary>
    /// Add the nodes of the .NET heap for the process 'processID' to 'memoryGraph' sending diagnostic
    /// messages to 'log'.  If 'memoryGraph' is null, the ETW providers are triggered by we obviously
    /// don't update the memoryGraph.  Thus it is only done for the side effect of triggering a .NET heap
    /// dump. returns true if successful.
    /// </summary>
    static public bool Dump(int processID, MemoryGraph memoryGraph, TextWriter log, DotNetHeapInfo dotNetInfo = null)
    {
        var sw     = Stopwatch.StartNew();
        var dumper = new DotNetHeapDumpGraphReader(log);

        dumper.DotNetHeapInfo = dotNetInfo;
        bool dumpComplete         = false;
        bool listening            = false;
        TraceEventSession session = null;
        Task readerTask           = null;

        try
        {
            bool     etwDataPresent = false;
            TimeSpan lastEtwUpdate  = sw.Elapsed;
            // Set up a separate thread that will listen for ETW events coming back telling us we succeeded.
            readerTask = Task.Factory.StartNew(delegate
            {
                string sessionName   = "PerfViewGCHeapSession";
                session              = new TraceEventSession(sessionName, null);
                int gcNum            = -1;
                session.BufferSizeMB = 256;         // Events come pretty fast, so make the buffer bigger.

                // Start the providers and trigger the GCs.
                log.WriteLine("{0,5:n1}s: Requesting a .NET Heap Dump", sw.Elapsed.TotalSeconds);
                // Have to turn on Kernel provider first (before touching Source) so we do it here.
                session.EnableKernelProvider(KernelTraceEventParser.Keywords.Process | KernelTraceEventParser.Keywords.ImageLoad);

                session.Source.Clr.GCStart += delegate(GCStartTraceData data)
                {
                    if (data.ProcessID != processID)
                    {
                        return;
                    }
                    etwDataPresent = true;

                    if (gcNum < 0 && data.Depth == 2 && data.Type != GCType.BackgroundGC)
                    {
                        gcNum = data.Count;
                        log.WriteLine("{0,5:n1}s: Dot Net Dump Started...", sw.Elapsed.TotalSeconds);
                    }
                };

                session.Source.Clr.GCStop += delegate(GCEndTraceData data)
                {
                    if (data.ProcessID != processID)
                    {
                        return;
                    }

                    if (data.Count == gcNum)
                    {
                        log.WriteLine("{0,5:n1}s: DotNet GC Complete.", sw.Elapsed.TotalSeconds);
                        dumpComplete = true;
                    }
                };

                session.Source.Clr.GCBulkNode += delegate(GCBulkNodeTraceData data)
                {
                    if (data.ProcessID != processID)
                    {
                        return;
                    }
                    etwDataPresent = true;

                    if ((sw.Elapsed - lastEtwUpdate).TotalMilliseconds > 500)
                    {
                        log.WriteLine("{0,5:n1}s: Making  GC Heap Progress...", sw.Elapsed.TotalSeconds);
                    }
                    lastEtwUpdate = sw.Elapsed;
                };

                if (memoryGraph != null)
                {
                    dumper.SetupCallbacks(memoryGraph, session.Source, processID.ToString());
                }

                listening = true;
                session.Source.Process();
                log.WriteLine("{0,5:n1}s: ETW Listener dieing", sw.Elapsed.TotalSeconds);
            });

            // Wait for thread above to start listening (should be very fast)
            while (!listening)
            {
                readerTask.Wait(1);
            }
            Debug.Assert(session != null);

            // Request the heap dump.   We try to isolate this to a single process.
            var options = new TraceEventProviderOptions()
            {
                ProcessIDFilter = new List <int>()
                {
                    processID
                }
            };

            // For non-project N we need module rundown to figure out the correct module name
            session.EnableProvider(ClrRundownTraceEventParser.ProviderGuid, TraceEventLevel.Verbose,
                                   (ulong)(ClrRundownTraceEventParser.Keywords.Loader | ClrRundownTraceEventParser.Keywords.ForceEndRundown), options);

            session.EnableProvider(ClrTraceEventParser.ProviderGuid, TraceEventLevel.Informational, (ulong)ClrTraceEventParser.Keywords.GCHeapSnapshot, options);
            // Project N support.
            session.EnableProvider(ClrTraceEventParser.NativeProviderGuid, TraceEventLevel.Informational, (ulong)ClrTraceEventParser.Keywords.GCHeapSnapshot, options);

            for (; ;)
            {
                if (readerTask.Wait(100))
                {
                    break;
                }

                if (!etwDataPresent && sw.Elapsed.TotalSeconds > 5)      // Assume it started within 5 seconds.
                {
                    log.WriteLine("{0,5:n1}s: Assume no Dot Heap", sw.Elapsed.TotalSeconds);
                    break;
                }
                if (sw.Elapsed.TotalSeconds > 100)       // Time out after 100 seconds.
                {
                    log.WriteLine("{0,5:n1}s: Timed out after 100 seconds", sw.Elapsed.TotalSeconds);
                    break;
                }
                // TODO FIX NOW, time out faster if we seek to be stuck
                if (dumpComplete)
                {
                    break;
                }
            }
            if (etwDataPresent)
            {
                dumper.ConvertHeapDataToGraph();        // Finish the conversion.
            }
        }
        finally
        {
            // Stop the ETW providers
            log.WriteLine("{0,5:n1}s: Shutting down ETW session", sw.Elapsed.TotalSeconds);
            if (session != null)
            {
                session.Dispose();
            }
        }
        if (readerTask != null)
        {
            log.WriteLine("{0,5:n1}s: Waiting for shutdown to complete.", sw.Elapsed.TotalSeconds);
            if (!readerTask.Wait(2000))
            {
                log.WriteLine("{0,5:n1}s: Shutdown wait timed out after 2 seconds.", sw.Elapsed.TotalSeconds);
            }
        }
        log.WriteLine("[{0,5:n1}s: Done Dumping .NET heap success={1}]", sw.Elapsed.TotalSeconds, dumpComplete);

        return(dumpComplete);
    }
Beispiel #49
0
    //private void LateUpdate()
    //{

    //}
    // Update is called once per frame
    void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            isPress = true;
        }
        if (Input.GetMouseButtonUp(0))
        {
            isPress = false;
        }
        //暂时只做水平滑动
        //CellItem target1 = GetLipObj(2);
        //Debug.LogError("index1111111>>>>>>>>>>>>>" + target1.obj.transform.GetSiblingIndex());
        float curPos = sContent.localPosition.x;

        if (curPos < lastPos)
        {
            //往左滑动
            CellItem target = GetLipObj(2);
            if (target.index >= maxNum - 1)
            {
                lastPos = curPos;
                Debug.Log(string.Format("Now is get List ending,target.index:{0},maxNum:{1}", target.index, maxNum));
                return;
            }
            if (target.obj.transform.position.x - targetLength / 2 <= mainContainer.transform.position.x + containerLength / 2)
            {
                Debug.LogError("index>>>>>>>>>>>>>" + target.obj.transform.GetSiblingIndex());
                Debug.LogError("name>>>>>>>>>>>>>" + target.obj.name);
                Debug.LogError("targetPos.x>>>>>>>>>>>>>" + target.obj.transform.position.x);

                //开始设置下一个cell
                bool result   = SetOrder(target, 2);
                int  nowIndex = allObjs.IndexOf(target);
                var  nextItem = allObjs[nowIndex + 1];
                cellCallback(nextItem.obj, target.index + 1);
                nextItem.index = target.index + 1;
                //if (result)
                //{

                //}
            }
        }
        else if (curPos > lastPos)
        {
            //Debug.Log(string.Format("curPos>>>{0},lastPos>>>{1}", curPos, lastPos));
            //往右滑动
            CellItem target = GetLipObj(1);
            if (target.index <= 0)
            {
                lastPos = curPos;
                Debug.Log(string.Format("Now is get List ending,target.index:{0},maxNum:{1}", target.index, maxNum));
                return;
            }
            if (target.obj.transform.position.x + targetLength / 2 >= mainContainer.transform.position.x - containerLength / 2)
            {
                //开始设置下一个cell
                bool result       = SetOrder(target, 1);
                int  nowSiblIndex = allObjs.IndexOf(target);
                cellCallback(allObjs[nowSiblIndex - 1].obj, target.index - 1);
                allObjs[nowSiblIndex - 1].index = target.index - 1;
                //if (result)
                //{

                //}
            }
        }
        lastPos = curPos;
    }
    /// <summary>
    /// 分享按钮事件
    /// </summary>
    //public void OnBtnGooglePlayClick(Text text)
    //{
    //    AudioMgr._instance.PlayFx("Btn");
    //    if (GooglePlayService.Instance.GetLoginState())
    //    {
    //        GooglePlayService.Instance.ShowAllAcheivement();
    //    }
    //    else
    //    {
    //        GooglePlayService.Instance.LoginIn(
    //            (sucess)=>
    //            {
    //                if (sucess)
    //                {
    //                    text.text = "查看";
    //                }
    //            });
    //    }
    //}

    /// <summary>
    /// 关于游戏按钮事件
    /// </summary>
    public void OnBtnAboutAuthorClick()
    {
        Debug.Log("关于游戏");
        AudioMgr._instance.PlayFx("Btn");
        aboutGame.transform.DOScale(new Vector2(1f, 1f), 0.5f);
    }
Beispiel #51
0
 public void Move()
 {
     position += Vector3.forward * Time.deltaTime * speed;
     Debug.Log("Enemy2 Position" + position);
 }
Beispiel #52
0
        private EmbeddedType EmbedType(
            NamedTypeSymbol namedType,
            bool fromImplements,
            CSharpSyntaxNode syntaxNodeOpt,
            DiagnosticBag diagnostics)
        {
            Debug.Assert(namedType.IsDefinition);

            EmbeddedType embedded = new EmbeddedType(this, namedType);
            EmbeddedType cached   = EmbeddedTypesMap.GetOrAdd(namedType, embedded);

            bool isInterface = (namedType.IsInterface);

            if (isInterface && fromImplements)
            {
                // Note, we must use 'cached' here because we might drop 'embedded' below.
                cached.EmbedAllMembersOfImplementedInterface(syntaxNodeOpt, diagnostics);
            }

            if (embedded != cached)
            {
                return(cached);
            }

            // We do not expect this method to be called on a different thread once GetTypes is called.
            // Therefore, the following check can be as simple as:
            Debug.Assert(!IsFrozen, "Set of embedded types is frozen.");

            var noPiaIndexer = new Cci.NoPiaReferenceIndexer(new EmitContext(ModuleBeingBuilt, syntaxNodeOpt, diagnostics));

            // Make sure we embed all types referenced by the type declaration: implemented interfaces, etc.
            noPiaIndexer.VisitTypeDefinitionNoMembers(embedded);

            if (!isInterface)
            {
                Debug.Assert(namedType.TypeKind == TypeKind.Struct || namedType.TypeKind == TypeKind.Enum || namedType.TypeKind == TypeKind.Delegate);
                // For structures, enums and delegates we embed all members.

                if (namedType.TypeKind == TypeKind.Struct || namedType.TypeKind == TypeKind.Enum)
                {
                    // TODO: When building debug versions in the IDE, the compiler will insert some extra members
                    // that support ENC. These make no sense in local types, so we will skip them. We have to
                    // check for them explicitly or they will trip the member-validity check that follows.
                }

                foreach (FieldSymbol f in namedType.GetFieldsToEmit())
                {
                    EmbedField(embedded, f, syntaxNodeOpt, diagnostics);
                }

                foreach (MethodSymbol m in namedType.GetMethodsToEmit())
                {
                    if ((object)m != null)
                    {
                        EmbedMethod(embedded, m, syntaxNodeOpt, diagnostics);
                    }
                }

                // We also should embed properties and events, but we don't need to do this explicitly here
                // because accessors embed them automatically.
            }

            return(embedded);
        }
Beispiel #53
0
 /// <summary>
 /// Definition of distant syslog server
 /// </summary>
 /// <param name="serverAddress">IP address or DNS</param>
 /// <param name="protocol">Protocol: UDP or TCP</param>
 /// <param name="port">Integer between 1 to 65535</param>
 /// <param name="memoryBufferMaxSize">Memory buffer size. Only used for TCP protocol.</param>
 /// <param name="debug">Debug object</param>
 public SyslogServer(String serverAddress, String protocol, int port, int memoryBufferMaxSize, ref Debug debug)
 {
     SetServerAddress(serverAddress);
     SetPort(port);
     SetProtocol(protocol.ToLower());
     this._MemoryBufferMaxSize = memoryBufferMaxSize;
     SetSyslogLevelAndFacility();
     this._Debug = debug;
 }
Beispiel #54
0
        internal static string CreateLaunchOptions(
            string program,
            string workingDirectory,
            string args,
            bool isPipeLaunch,
            out bool stopAtEntry,
            out bool isCoreDump,
            out bool debugServerUsed,
            out bool isOpenOCD,
            out bool visualizerFileUsed)
        {
            stopAtEntry = false;
            isCoreDump = false;
            debugServerUsed = false;
            isOpenOCD = false;
            visualizerFileUsed = false;

            LaunchOptionType launchType = isPipeLaunch ? LaunchOptionType.Pipe : LaunchOptionType.Local;

            if (launchType == LaunchOptionType.Local)
            {
                JsonLocalLaunchOptions jsonLaunchOptions = JsonConvert.DeserializeObject<JsonLocalLaunchOptions>(args);
                StringBuilder xmlLaunchOptions = new StringBuilder();
                xmlLaunchOptions.Append("<LocalLaunchOptions xmlns='http://schemas.microsoft.com/vstudio/MDDDebuggerOptions/2014'\n");
                AddBaseLaunchOptionsAttributes(xmlLaunchOptions, jsonLaunchOptions, program, workingDirectory);

                string lldbPath = null;
                if (String.Equals(jsonLaunchOptions.MIMode, "lldb", StringComparison.Ordinal)
                    && String.IsNullOrEmpty(jsonLaunchOptions.MIDebuggerPath))
                {
                    //find LLDBMI
                    lldbPath = GetLLDBMIPath();
                }
                xmlLaunchOptions.Append(String.Concat("  MIDebuggerPath='", lldbPath ?? jsonLaunchOptions.MIDebuggerPath, "'\n"));
                if (!String.IsNullOrEmpty(jsonLaunchOptions.MIDebuggerArgs))
                {
                    string miDebuggerArgs = XmlSingleQuotedAttributeEncode(jsonLaunchOptions.MIDebuggerArgs);
                    xmlLaunchOptions.Append(String.Concat("  MIDebuggerArgs='", miDebuggerArgs, "'\n"));
                }

                // If we get SymbolLoadInfo and an ExceptionList or LoadAll is set. We will need to have WaitDynamicLibLoad.
                if (jsonLaunchOptions.SymbolLoadInfo != null && 
                    (!String.IsNullOrWhiteSpace(jsonLaunchOptions.SymbolLoadInfo.ExceptionList) || jsonLaunchOptions.SymbolLoadInfo.LoadAll.HasValue))
                {
                    xmlLaunchOptions.Append(String.Concat("  WaitDynamicLibLoad='true'\n"));
                }
                else
                {
                    xmlLaunchOptions.Append(String.Concat("  WaitDynamicLibLoad='false'\n"));
                }

                if (jsonLaunchOptions.MIDebuggerServerAddress != null)
                {
                    xmlLaunchOptions.Append(String.Concat("  MIDebuggerServerAddress='", jsonLaunchOptions.MIDebuggerServerAddress, "'\n"));
                }

                if (jsonLaunchOptions.ProcessId != 0)
                {
                    xmlLaunchOptions.Append(String.Concat("  ProcessId='", jsonLaunchOptions.ProcessId, "'\n"));
                }

                isCoreDump = !String.IsNullOrEmpty(jsonLaunchOptions.CoreDumpPath);
                stopAtEntry = !isCoreDump && jsonLaunchOptions.StopAtEntry;

                if (jsonLaunchOptions.DebugServerPath != null)
                {
                    xmlLaunchOptions.Append(String.Concat("  DebugServer='", jsonLaunchOptions.DebugServerPath, "'\n"));

                    if (!String.IsNullOrWhiteSpace(jsonLaunchOptions.DebugServerPath))
                    {
                        debugServerUsed = true;
                        StringComparison comparison = StringComparison.Ordinal;
                        if (Utilities.IsWindows())
                        {
                            comparison = StringComparison.OrdinalIgnoreCase;
                        }
                        isOpenOCD = Path.GetFileNameWithoutExtension(jsonLaunchOptions.DebugServerPath).Equals("openocd", comparison);
                    }
                }
                if (jsonLaunchOptions.DebugServerArgs != null)
                {
                    xmlLaunchOptions.Append(String.Concat("  DebugServerArgs='", jsonLaunchOptions.DebugServerArgs, "'\n"));
                }
                if (jsonLaunchOptions.ServerStarted != null)
                {
                    xmlLaunchOptions.Append(String.Concat("  ServerStarted='", jsonLaunchOptions.ServerStarted, "'\n"));
                }
                if (jsonLaunchOptions.FilterStdout)
                {
                    xmlLaunchOptions.Append(String.Concat("  FilterStdout='", jsonLaunchOptions.FilterStdout ? "true" : "false", "'\n"));
                }
                if (jsonLaunchOptions.FilterStderr)
                {
                    xmlLaunchOptions.Append(String.Concat("  FilterStderr='", jsonLaunchOptions.FilterStderr ? "true" : "false", "'\n"));
                }
                if (jsonLaunchOptions.ServerLaunchTimeout != 0)
                {
                    xmlLaunchOptions.Append(String.Concat("  ServerLaunchTimeout='", jsonLaunchOptions.ServerLaunchTimeout, "'\n"));
                }
                if (jsonLaunchOptions.ExternalConsole)
                {
                    xmlLaunchOptions.Append("  ExternalConsole='true'\n");
                }

                xmlLaunchOptions.Append(">\n");

                AddBaseLaunchOptionsElements(xmlLaunchOptions, jsonLaunchOptions);

                bool environmentDefined = jsonLaunchOptions.Environment?.Length > 0;
                if (environmentDefined)
                {
                    xmlLaunchOptions.Append("    <Environment>\n");
                    foreach (EnvironmentEntry envEntry in jsonLaunchOptions.Environment)
                    {
                        AddEnvironmentVariable(xmlLaunchOptions, envEntry.Name, envEntry.Value);
                    }
                    xmlLaunchOptions.Append("    </Environment>\n");
                }

                if (jsonLaunchOptions.Env.Count > 0)
                {
                    if (environmentDefined)
                    {
                        throw new ArgumentException(AD7Resources.Error_ConflictingEnvProps);
                    }

                    xmlLaunchOptions.Append("    <Environment>\n");
                    foreach (KeyValuePair<string, string> pair in jsonLaunchOptions.Env)
                    {
                        AddEnvironmentVariable(xmlLaunchOptions, pair.Key, pair.Value);
                    }
                    xmlLaunchOptions.Append("    </Environment>\n");
                }

                if (jsonLaunchOptions.SymbolLoadInfo != null)
                {
                    xmlLaunchOptions.Append("    <SymbolLoadInfo ");
                    if (jsonLaunchOptions.SymbolLoadInfo.LoadAll.HasValue)
                    {
                        xmlLaunchOptions.Append("LoadAll = '" + jsonLaunchOptions.SymbolLoadInfo.LoadAll.Value.ToString().ToLowerInvariant() + "' ");
                    }

                    if (!String.IsNullOrWhiteSpace(jsonLaunchOptions.SymbolLoadInfo.ExceptionList))
                    {
                        xmlLaunchOptions.Append("ExceptionList='" + XmlSingleQuotedAttributeEncode(jsonLaunchOptions.SymbolLoadInfo.ExceptionList) + "' ");
                    }

                    xmlLaunchOptions.Append("/>\n");
                }

                xmlLaunchOptions.Append("</LocalLaunchOptions>");

                visualizerFileUsed = jsonLaunchOptions.VisualizerFile != null;

                return xmlLaunchOptions.ToString();
            }
            else if (launchType == LaunchOptionType.Pipe)
            {
                JsonPipeLaunchOptions jsonLaunchOptions = JsonConvert.DeserializeObject<JsonPipeLaunchOptions>(args.ToString());

                stopAtEntry = jsonLaunchOptions.StopAtEntry;

                StringBuilder xmlLaunchOptions = new StringBuilder();
                xmlLaunchOptions.Append("<PipeLaunchOptions xmlns='http://schemas.microsoft.com/vstudio/MDDDebuggerOptions/2014'\n");

                AddBaseLaunchOptionsAttributes(xmlLaunchOptions, jsonLaunchOptions, program, workingDirectory);

                string pipeCwd = jsonLaunchOptions.PipeTransport.PipeCwd;
                string pipeProgram = jsonLaunchOptions.PipeTransport.PipeProgram;
                string[] pipeArgs = jsonLaunchOptions.PipeTransport.PipeArgs;
                string processId = jsonLaunchOptions.ProcessId;
                Dictionary<string, string> pipeEnv = jsonLaunchOptions.PipeTransport.PipeEnv;

                JsonPipeTransportOptions platformSpecificTransportOptions = null;
                if (Utilities.IsOSX() && jsonLaunchOptions.PipeTransport.OSX != null)
                {
                    platformSpecificTransportOptions = jsonLaunchOptions.PipeTransport.OSX;
                }
                else if (Utilities.IsLinux() && jsonLaunchOptions.PipeTransport.Linux != null)
                {
                    platformSpecificTransportOptions = jsonLaunchOptions.PipeTransport.Linux;
                }
                else if (Utilities.IsWindows() && jsonLaunchOptions.PipeTransport.Windows != null)
                {
                    platformSpecificTransportOptions = jsonLaunchOptions.PipeTransport.Windows;
                }

                if (platformSpecificTransportOptions != null)
                {
                    pipeProgram = platformSpecificTransportOptions.PipeProgram ?? pipeProgram;
                    pipeArgs = platformSpecificTransportOptions.PipeArgs ?? pipeArgs;
                    pipeCwd = platformSpecificTransportOptions.PipeCwd ?? pipeCwd;
                    pipeEnv = platformSpecificTransportOptions.PipeEnv ?? pipeEnv;
                }

                if (string.IsNullOrWhiteSpace(pipeProgram))
                {
                    throw new ArgumentException(String.Format(CultureInfo.CurrentCulture, "Invalid pipeProgram option. pipeProgram should not be null or empty. Args: {0}", args));
                }

                xmlLaunchOptions.Append(String.Concat("  PipePath='", pipeProgram, "'\n"));

                if (pipeArgs != null)
                {
                    string pipeCommandArgs = CreateArgumentList(pipeArgs);
                    IEnumerable<string> allPipeArguments = pipeArgs;
                    string debuggerPath = jsonLaunchOptions.PipeTransport.DebuggerPath ?? "";
                    if (!string.IsNullOrEmpty(debuggerPath))
                    {
                        string fullDebuggerCommandline = string.Format(CultureInfo.InvariantCulture, "{0} --interpreter=mi", debuggerPath);
                        if (allPipeArguments.Any(x => x.Contains(DebuggerCommandMacro)))
                        {
                            allPipeArguments = allPipeArguments.Select(x => x.Replace(DebuggerCommandMacro, fullDebuggerCommandline));
                        }
                        else
                        {
                            allPipeArguments = allPipeArguments.Concat(new string[] { fullDebuggerCommandline });
                        }
                    }

                    string allArguments = CreateArgumentList(allPipeArguments);
                    xmlLaunchOptions.Append(String.Concat("  PipeArguments='", MILaunchOptions.XmlSingleQuotedAttributeEncode(allArguments), "'\n"));

                    // debuggerPath has to be specified. if it isn't then the debugger is specified in PipeArg which means we can't use the same arguments for pipeCommandArgs
                    if (!string.IsNullOrEmpty(debuggerPath))
                    {
                        xmlLaunchOptions.Append(String.Concat("  PipeCommandArguments='", MILaunchOptions.XmlSingleQuotedAttributeEncode(pipeCommandArgs), "'\n"));
                    }
                }

                if (pipeCwd != null)
                {
                    xmlLaunchOptions.Append(String.Concat("  PipeCwd='", MILaunchOptions.XmlSingleQuotedAttributeEncode(pipeCwd), "'\n"));
                }

                if (!String.IsNullOrEmpty(processId))
                {
                    xmlLaunchOptions.Append(String.Concat("  ProcessId='", processId, "'\n"));
                }

                xmlLaunchOptions.Append(">\n");

                AddBaseLaunchOptionsElements(xmlLaunchOptions, jsonLaunchOptions);

                if (pipeEnv != null && pipeEnv.Count > 0)
                {
                    xmlLaunchOptions.Append("    <PipeEnvironment>\n");
                    foreach (KeyValuePair<string, string> pair in pipeEnv)
                    {
                        AddEnvironmentVariable(xmlLaunchOptions, pair.Key, pair.Value);
                    }
                    xmlLaunchOptions.Append("    </PipeEnvironment>\n");
                }

                xmlLaunchOptions.Append("</PipeLaunchOptions>");

                return xmlLaunchOptions.ToString();
            }
            // Commented out for now as we aren't supporting these options.
            //else if (args.transport == "Tcp")
            //{
            //    JsonTcpLaunchOptions jsonLaunchOptions = JsonConvert.DeserializeObject<JsonTcpLaunchOptions>(args.ToString());

            //    StringBuilder xmlLaunchOptions = new StringBuilder();
            //    xmlLaunchOptions.Append("<TcpLaunchOptions xmlns='http://schemas.microsoft.com/vstudio/MDDDebuggerOptions/2014'\n");
            //    AddBaseLaunchOptionsAttributes(xmlLaunchOptions, jsonLaunchOptions, program, workingDirectory);

            //    xmlLaunchOptions.Append(String.Concat("  HostName='", jsonLaunchOptions.HostName, "'\n"));
            //    xmlLaunchOptions.Append(String.Concat("  PipePath='", jsonLaunchOptions.Port, "'\n"));
            //    // NOTE: depending on default value of bool to be false.
            //    xmlLaunchOptions.Append(String.Concat("  Secure='", jsonLaunchOptions.Secure ? "true" : "false", "'\n"));

            //    xmlLaunchOptions.Append(">\n");

            //    AddBaseLaunchOptionsElements(xmlLaunchOptions, jsonLaunchOptions);

            //    xmlLaunchOptions.Append("</TcpLaunchOptions>");

            //    return xmlLaunchOptions.ToString();
            //}

            Debug.Fail("We should not get here. All the launch types should be handled above.");
            throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, AD7Resources.Error_Internal_Launch, launchType, args));
        }
Beispiel #55
0
 /// <summary>
 /// Gets the name of the parent
 /// </summary>
 /// <param name="parent">The parent whose name to get</param>
 private string GetParentName(Debug parent)
 {
     return null == parent ? string.Empty : null == parent.Parent ? parent.Name.Substring(1) : parent.Name;
 }
Beispiel #56
0
 internal override void Cut()
 {
     Debug.WriteLine("Cutting the pizza into square slices");
 }
Beispiel #57
0
 void Awake()
 {
     instance = this;
 }
Beispiel #58
0
        public void CheckPrefab(params string[] paths)
        {
            paths = paths.Where(p => !PathFilter(p)).ToArray();
            var i = 0;
            var t = paths.Length;

            foreach (var path in paths)
            {
                var importer = AssetImporter.GetAtPath(path);
                var p        = (float)i++ / (float)t;

                if (importer is ModelImporter)
                {
                    if (!modelPathToApply.Contains(path))
                    {
                        continue;
                    }

                    var asset = PEUtils.GetAssetByPath <GameObject>(path);
                    if (asset == null)
                    {
                        continue;
                    }

                    var prefabScript = asset.GetComponent <PEPrefabScript>();
                    if (prefabScript == null)
                    {
                        continue;
                    }

                    modelPathToApply.Remove(path);

                    if (PEPrefs.DebugLevel > 0)
                    {
                        Debug.Log("Applying " + path);
                    }
                    prefabScript.Prefab = asset;
                    prefabScript.BuildLinks();
                    EditorApplication.delayCall += () => PEUtils.DoApply(prefabScript);
                }
                else
                {
                    if (!path.EndsWith(".prefab"))
                    {
                        continue;
                    }

                    CheckPrefab(AssetDatabase.AssetPathToGUID(path), PEUtils.GetAssetByPath <GameObject>(path));

                    if (paths.Length > 10 && i % 50 == 0)
                    {
                        EditorUtility.DisplayProgressBar("Checking prefab dependencies", path, p);
                    }

                    if (i % 100 == 0)
                    {
                                        #if UNITY_5
                        EditorUtility.UnloadUnusedAssetsImmediate();
                                        #else
                        EditorUtility.UnloadUnusedAssets();
                                        #endif
                    }
                }
            }
            if (paths.Length > 10)
            {
                EditorUtility.ClearProgressBar();
            }
        }
Beispiel #59
0
 private void debugToolStripMenuItem_Click(object sender, EventArgs e)
 {
     var f = new Debug();
     f.MdiParent = this;
     f.Show();
 }
Beispiel #60
0
 public override void Handle(AlienGroup pGrid)
 {
     Debug.Assert(pGrid != null);
     pGrid.ChangeState(MoveState.GridMoveToLeft);
 }