<commit_before>﻿using System;
using System.ComponentModel;
using UIKit;
using Foundation;
using ObjCRuntime;
using CoreAnimation;

using OpenTK;
using OpenTK.Graphics;
using OpenTK.Graphics.ES20;
using OpenTK.Platform;
using OpenTK.Platform.iPhoneOS;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

using RectangleF=CoreGraphics.CGRect;
using SizeF=CoreGraphics.CGSize;
using OpenGLES;

namespace CocosSharp
{
    class GameViewTimeSource  
    {
        TimeSpan timeout;
        NSTimer timer;

        CCGameView view;

        public GameViewTimeSource(CCGameView view, double updatesPerSecond)
        {
            this.view = view;

            // Can't use TimeSpan.FromSeconds() as that only has 1ms
            // resolution, and we need better (e.g. 60fps doesn't fit nicely
            // in 1ms resolution, but does in ticks).
            timeout = new TimeSpan((long) (((1.0 * TimeSpan.TicksPerSecond) / updatesPerSecond) + 0.5));
        }

        public void Suspend()
        {
            if (timer != null) {
                timer.Invalidate();
                timer = null;
            }
        }

        public void Resume()
        {
            if (timeout != new TimeSpan (-1)) 
            {
                timer = NSTimer.CreateRepeatingTimer(timeout, view.RunIteration);
                NSRunLoop.Main.AddTimer(timer, NSRunLoopMode.Common);
            }
        }

        public void Invalidate()
        {
            if (timer != null) 
            {
                timer.Invalidate();
                timer = null;
            }
        }
    }


    [Register("CCGameView"), DesignTimeVisible(true)]
    public partial class CCGameView : iPhoneOSGameView
    {
        bool bufferCreated;
        uint depthbuffer;

        GameViewTimeSource timeSource;


        #region Constructors

        [Export("initWithCoder:")]
        public CCGameView(NSCoder coder) 
            : base(coder)
        {
            BeginInitiliase();
        }

        public CCGameView(RectangleF frame)
            : base(frame)
        {
            BeginInitiliase();
        }

        void BeginInitiliase()<commit_msg>[Cleanup] - Fix mispelling BeginInitiliase ->  BeginInitialise<commit_after>﻿using System;
using System.ComponentModel;
using UIKit;
using Foundation;
using ObjCRuntime;
using CoreAnimation;

using OpenTK;
using OpenTK.Graphics;
using OpenTK.Graphics.ES20;
using OpenTK.Platform;
using OpenTK.Platform.iPhoneOS;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

using RectangleF=CoreGraphics.CGRect;
using SizeF=CoreGraphics.CGSize;
using OpenGLES;

namespace CocosSharp
{
    class GameViewTimeSource  
    {
        TimeSpan timeout;
        NSTimer timer;

        CCGameView view;

        public GameViewTimeSource(CCGameView view, double updatesPerSecond)
        {
            this.view = view;

            // Can't use TimeSpan.FromSeconds() as that only has 1ms
            // resolution, and we need better (e.g. 60fps doesn't fit nicely
            // in 1ms resolution, but does in ticks).
            timeout = new TimeSpan((long) (((1.0 * TimeSpan.TicksPerSecond) / updatesPerSecond) + 0.5));
        }

        public void Suspend()
        {
            if (timer != null) {
                timer.Invalidate();
                timer = null;
            }
        }

        public void Resume()
        {
            if (timeout != new TimeSpan (-1)) 
            {
                timer = NSTimer.CreateRepeatingTimer(timeout, view.RunIteration);
                NSRunLoop.Main.AddTimer(timer, NSRunLoopMode.Common);
            }
        }

        public void Invalidate()
        {
            if (timer != null) 
            {
                timer.Invalidate();
                timer = null;
            }
        }
    }


    [Register("CCGameView"), DesignTimeVisible(true)]
    public partial class CCGameView : iPhoneOSGameView
    {
        bool bufferCreated;
        uint depthbuffer;

        GameViewTimeSource timeSource;


        #region Constructors

        [Export("initWithCoder:")]
        public CCGameView(NSCoder coder) 
            : base(coder)
        {
            BeginInitialise();
        }

        public CCGameView(RectangleF frame)
            : base(frame)
        {
            BeginInitialise();
        }

        void BeginInitialise()
{'fraction_non_alphanumeric': 0.08730339639844996, 'fraction_numerical': 0.00501481650330522, 'mean_word_length': 1.802043422733078, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2871313', 'n_tokens_mistral': 1261, 'n_tokens_neox': 1187, 'n_words': 283}