예제 #1
0
        public void InvokeCompletion()
        {
            EventBinder <Action> onDispose = new EventBinder <Action>(e => OnSoftDispose += e, e => OnSoftDispose -= e);

            onDispose.IsOneTime = true;
            onDispose.SetHandler(() =>
            {
                OnCompletion?.Invoke();

                // Wait for completion timeout to auto navigate to results.
                SynchronizedTimer autoExitTimer = new SynchronizedTimer()
                {
                    Limit = 2f,
                };
                autoExitTimer.OnFinished += Model.ExitGameToResult;
                autoExitTimer.Start();
            });

            SynchronizedTimer initialTimer = new SynchronizedTimer()
            {
                Limit = 0.5f
            };

            initialTimer.OnFinished += InvokeSoftDispose;
            initialTimer.Start();
        }
예제 #2
0
        public void Create(object masterView, string backgroundImageName, string logoImageName, bool scaleImage, RectangleF frame, OnCompletion onCompletion)
        {
            View = PlatformView.Create( );
            View.BackgroundColor = 0;
            View.AddAsSubview(masterView);

            ImageBG = PlatformImageView.Create( );
            ImageBG.BackgroundColor = ControlStylingConfig.OOBE_Splash_BG_Color;
            ImageBG.AddAsSubview(masterView);

            // if a background image was provided, use that.
            if (string.IsNullOrEmpty(backgroundImageName) == false)
            {
                MemoryStream stream = Rock.Mobile.IO.AssetConvert.AssetToStream(backgroundImageName);
                stream.Position        = 0;
                ImageBG.Image          = stream;
                ImageBG.ImageScaleType = PlatformImageView.ScaleType.ScaleAspectFit;
                stream.Dispose( );
            }

            MemoryStream logoStream = Rock.Mobile.IO.AssetConvert.AssetToStream(logoImageName);

            logoStream.Position = 0;
            ImageLogo           = PlatformImageView.Create( );
            ImageLogo.AddAsSubview(masterView);
            ImageLogo.Image          = logoStream;
            ImageLogo.ImageScaleType = PlatformImageView.ScaleType.ScaleAspectFit;
            logoStream.Dispose( );

            OnCompletionCallback = onCompletion;
        }
예제 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TransactionApplication" /> class.
 /// </summary>
 /// <param name="accounts">\\[apat\\] List of accounts in addition to the sender that may be accessed from the application&#x27;s approval-program and clear-state-program..</param>
 /// <param name="applicationArgs">\\[apaa\\] transaction specific arguments accessed from the application&#x27;s approval-program and clear-state-program..</param>
 /// <param name="applicationId">\\[apid\\] ID of the application being configured or empty if creating. (required).</param>
 /// <param name="approvalProgram">\\[apap\\] Logic executed for every application transaction, except when on-completion is set to \&quot;clear\&quot;. It can read and write global state for the application, as well as account-specific local state. Approval programs may reject the transaction..</param>
 /// <param name="clearStateProgram">\\[apsu\\] Logic executed for application transactions with on-completion set to \&quot;clear\&quot;. It can read and write global state for the application, as well as account-specific local state. Clear state programs cannot reject the transaction..</param>
 /// <param name="foreignApps">\\[apfa\\] Lists the applications in addition to the application-id whose global states may be accessed by this application&#x27;s approval-program and clear-state-program. The access is read-only..</param>
 /// <param name="foreignAssets">\\[apas\\] lists the assets whose parameters may be accessed by this application&#x27;s ApprovalProgram and ClearStateProgram. The access is read-only..</param>
 /// <param name="globalStateSchema">globalStateSchema.</param>
 /// <param name="localStateSchema">localStateSchema.</param>
 /// <param name="onCompletion">onCompletion (required).</param>
 public TransactionApplication(List <string> accounts = default(List <string>), List <string> applicationArgs = default(List <string>), long?applicationId = default, byte[] approvalProgram = default(byte[]), byte[] clearStateProgram = default(byte[]), List <int?> foreignApps = default(List <int?>), List <int?> foreignAssets = default(List <int?>), StateSchema globalStateSchema = default(StateSchema), StateSchema localStateSchema = default(StateSchema), OnCompletion onCompletion = default(OnCompletion))
 {
     // to ensure "applicationId" is required (not null)
     if (applicationId == null)
     {
         throw new InvalidDataException("applicationId is a required property for TransactionApplication and cannot be null");
     }
     else
     {
         this.ApplicationId = applicationId;
     }
     // to ensure "onCompletion" is required (not null)
     if (onCompletion == null)
     {
         throw new InvalidDataException("onCompletion is a required property for TransactionApplication and cannot be null");
     }
     else
     {
         this.OnCompletion = onCompletion;
     }
     this.Accounts          = accounts;
     this.ApplicationArgs   = applicationArgs;
     this.ApprovalProgram   = approvalProgram;
     this.ClearStateProgram = clearStateProgram;
     this.ForeignApps       = foreignApps;
     this.ForeignAssets     = foreignAssets;
     this.GlobalStateSchema = globalStateSchema;
     this.LocalStateSchema  = localStateSchema;
 }
예제 #4
0
파일: Search.cs 프로젝트: tgiphil/GoTraxx
        public void Start(GoBoard goBoard, Color playerToMove, SearchOptions searchOptions, SearchMethodType searchMethodType, OnCompletion onCompletion)
        {
            // stop existing search, if any
            if (SearchInterface != null)
                Stop();

            if (SearchMethodType != searchMethodType)
            {
                SearchMethodType = searchMethodType;
                SearchInterface = SearchMethodFactory.CreateFactory(searchMethodType);
            }

            // make a private copy of the board
            Board = goBoard.Clone();

            // make a private copy of the search options
            SearchOptions = searchOptions.Clone();

            // set player to move
            PlayerToMove = playerToMove;

            // set the Nag Coordinator
            SearchInterface.SetNagCoordinator(NagCoordinator);

            // initialize the search parameters
            SearchInterface.Initialize(Board, PlayerToMove, SearchOptions, onCompletion);

            // start search
            SearchThread = new Thread(this.StartThread);
            SearchThread.Start();
        }
 protected override void CleanUp()
 {
     CloseStream();
     StreamWriter?.Close();
     OnCompletion?.Invoke();
     NLogFinish();
 }
예제 #6
0
        public void Create( object masterView, string backgroundImageName, string logoImageName, bool scaleImage, RectangleF frame, OnCompletion onCompletion )
        {
            View = PlatformView.Create( );
            View.BackgroundColor = 0;
            View.AddAsSubview( masterView );

            ImageBG = PlatformImageView.Create( true );
            ImageBG.BackgroundColor = ControlStylingConfig.OOBE_Splash_BG_Color;
            ImageBG.AddAsSubview( masterView );

            // if a background image was provided, use that.
            if ( string.IsNullOrEmpty( backgroundImageName ) == false )
            {
                MemoryStream stream = Rock.Mobile.IO.AssetConvert.AssetToStream( backgroundImageName );
                stream.Position = 0;
                ImageBG.Image = stream;
                ImageBG.SizeToFit( );
                ImageBG.ImageScaleType = PlatformImageView.ScaleType.ScaleAspectFit;
                stream.Dispose( );
            }

            MemoryStream logoStream = Rock.Mobile.IO.AssetConvert.AssetToStream( logoImageName );
            logoStream.Position = 0;
            ImageLogo = PlatformImageView.Create( scaleImage );
            ImageLogo.AddAsSubview( masterView );
            ImageLogo.Image = logoStream;
            ImageLogo.SizeToFit( );
            ImageLogo.ImageScaleType = PlatformImageView.ScaleType.ScaleAspectFit;
            logoStream.Dispose( );

            OnCompletionCallback = onCompletion;
        }
예제 #7
0
        /// <summary>
        ///     Login with the given username and password.
        /// </summary>
        /// <remarks>
        ///     You will need to do this before loading any profiles.
        ///     Also please note, that the result of this operation is always null!
        /// </remarks>
        /// <param name="username">The username that is used.</param>
        /// <param name="password">The password that is used.</param>
        /// <param name="onCompletion">The completion handler returns whether the login succeeded.</param>
        public bool Login(string username, string password, OnCompletion <object> onCompletion)
        {
            if (username == null || username.Equals("") || password == null || password.Equals(""))
            {
                Debug.Log("Please supply all expected parameters");
                onCompletion(false, null);
                return(false);
            }

            if ((_loggedInUser != null && username.Equals(_loggedInUser)) &&
                (_loginResponse != null && _loginResponse.IsValid))
            {
                Debug.Log("Login is still valid!");
                onCompletion(true, null);
                return(true); // TODO remove
            }

            _parent.StartChildCoroutine(_LoginCoroutine(username, password, response =>
            {
                _loginResponse = JsonConvert.DeserializeObject <LoginResponse>(response);
                _loggedInUser  = username;
                onCompletion(true, null);
            }, message =>
            {
                Debug.Log("An error occured while logging in...");
                Debug.Log(message);
                onCompletion(false, null);
            }));

            return(true); // TODO remove
        }
예제 #8
0
        public void Create(object masterView, bool scaleImage, RectangleF frame, OnCompletion onCompletion)
        {
            View = PlatformView.Create( );
            View.BackgroundColor = ControlStylingConfig.BackgroundColor;
            View.Frame           = frame;
            View.AddAsSubview(masterView);

            Credits = new List <Credit>();
            Credits.Add(new Credit("Hey you found me! I'm Jered, the mobile app developer here at CCV. Making this app was a ton of work, and couldn't have happened without the support of a ton of people!\n\nThanks so much to:\n" +
                                   "Jenni, my beautiful wife and very patient app tester!\n\n" +
                                   "Jon & David, for developing this app's backbone, Rock.\n\n" +
                                   "Mason & Mike for testing, end points, and endless puns! (See what I did there?)\n\n" +
                                   "Nick & Kyle for all the great artwork and design you see in this app.\n\n" +
                                   "Dan & Kris Simpson for HUGE feedback, testing, and movie nights!!\n\n" +
                                   "The IT boyz: Jim, `Stopher and Chris, for being extremely willing Android guinea pigs.\n\n" +
                                   "Matt, Emily, Robin, Jill and Bree, for their testing and feedback.\n\n\n" +
                                   "And thanks of course to all of you out there using the app and making CCV the awesome church that it is!",
                                   "me.png", scaleImage, frame, View));


            CloseButton = PlatformButton.Create( );
            CloseButton.AddAsSubview(View.PlatformNativeObject);
            CloseButton.Text            = "Got It!";
            CloseButton.BackgroundColor = PrayerConfig.PrayedForColor;
            CloseButton.TextColor       = ControlStylingConfig.Button_TextColor;
            CloseButton.CornerRadius    = ControlStylingConfig.Button_CornerRadius;
            CloseButton.SizeToFit( );
            CloseButton.ClickEvent = delegate(PlatformButton button)
            {
                OnCompletionCallback( );
            };

            OnCompletionCallback = onCompletion;
        }
예제 #9
0
        public void Complete(T result)
        {
            bool         signalCompletion   = false;
            OnCompletion completionCallback = null;

            lock (this)
            {
                if (State == ResultState.INCOMPLETE)
                {
                    State              = ResultState.COMPLETE;
                    Result             = result;
                    signalCompletion   = true;
                    completionCallback = OnCompletionCallback;
                }
                else
                {
                    throw new CrtException("Result already completed");
                }
            }

            if (signalCompletion)
            {
                if (completionCallback != null)
                {
                    completionCallback(result);
                }
                CompletionSignal.Set();
            }
        }
예제 #10
0
        public void Create(object masterView, bool scaleImage, string imageName, RectangleF frame, OnCompletion onCompletion)
        {
            View = PlatformView.Create( );
            View.BackgroundColor = ControlStylingConfig.BackgroundColor;
            View.Frame           = frame;
            View.AddAsSubview(masterView);

            MemoryStream logoStream = Rock.Mobile.IO.AssetConvert.AssetToStream(imageName);

            logoStream.Position = 0;
            PonyImage           = PlatformImageView.Create( );
            PonyImage.AddAsSubview(View.PlatformNativeObject);
            PonyImage.Image          = logoStream;
            PonyImage.ImageScaleType = PlatformImageView.ScaleType.ScaleAspectFit;
            logoStream.Dispose( );

            CloseButton = PlatformButton.Create( );
            CloseButton.AddAsSubview(View.PlatformNativeObject);
            CloseButton.Text            = "Prance! Dance! It's Magic Pony Time!";
            CloseButton.BackgroundColor = PrayerConfig.PrayedForColor;
            CloseButton.TextColor       = ControlStylingConfig.Button_TextColor;
            CloseButton.CornerRadius    = ControlStylingConfig.Button_CornerRadius;
            CloseButton.SizeToFit( );
            CloseButton.ClickEvent = delegate(PlatformButton button)
            {
                OnCompletionCallback( );
            };

            OnCompletionCallback = onCompletion;
        }
예제 #11
0
 public virtual void Wait()
 {
     TargetAction.Completion.Wait();
     CloseStreamsAction?.Invoke();
     OnCompletion?.Invoke();
     NLogFinish();
 }
예제 #12
0
        /// <summary>
        ///     Updates the user profile with the given id.
        /// </summary>
        /// <param name="id">The profile's id</param>
        /// <param name="preferenceTerms">The updated preference terms to save.</param>
        /// <param name="onCompletion">The completion handler returns whether the update of the profile succeeded.</param>
        internal bool UpdateProfile(string id, PreferenceTerms preferenceTerms, OnCompletion <object> onCompletion)
        {
            if (_loginResponse?.Token == null)
            {
                Debug.Log("You need to login first!");
                onCompletion(false, null);
                return(false); // TODO remove
            }

            if (!_loginResponse.IsValid)
            {
                Debug.Log("Login has expired!");
                onCompletion(false, null);
                return(false); // TODO remove
            }

            _parent.StartChildCoroutine(_UpdateProfileCoroutine(id, preferenceTerms, response => { onCompletion(true, null); }, message =>
            {
                Debug.Log("An error occured while updating user profile...");
                Debug.Log(message);
                onCompletion(false, null);
            }));

            return(true); // TODO remove
        }
예제 #13
0
 public CrtResult()
 {
     Result               = default(T);
     Exception            = null;
     CompletionSignal     = new ManualResetEvent(false);
     State                = ResultState.INCOMPLETE;
     OnCompletionCallback = null;
     OnExceptionCallback  = null;
 }
        /// <summary>
        /// Create a progress monitor with delegates for reporting status and completion
        /// </summary>
        /// <param name="report"></param>
        /// <param name="complete"></param>
        public ProgressMonitor(ReportStatus report, OnStart start = null, OnCompletion complete = null)
        {
            _reportStatus = report;
            _onStart      = start;
            _onCompletion = complete;

            monitor                            = new BackgroundWorker();
            monitor.DoWork                    += new DoWorkEventHandler(monitor_DoWork);
            monitor.RunWorkerCompleted        += new RunWorkerCompletedEventHandler(monitor_Completed);
            monitor.ProgressChanged           += new ProgressChangedEventHandler(monitor_ReportProgress);
            monitor.WorkerReportsProgress      = true;
            monitor.WorkerSupportsCancellation = true;
        }
예제 #15
0
        public void SimpleAsyncSearch(Color playerToMove, OnCompletion onCompletion)
        {
            SearchOptions lSearchOptions = GetSearchOptions(playerToMove);

            lSearchOptions.IncludeEndGameMoves = false;
            lSearchOptions.UsePatterns         = false;

            Board.Dump();

            Console.Error.WriteLine("Move Search: ");
            Console.Error.WriteLine("Max Level: " + lSearchOptions.MaxPly.ToString() + " - Max Time: " + lSearchOptions.MaxSeconds.ToString() + " Alpha: " + lSearchOptions.AlphaValue.ToString() + " Beta: " + lSearchOptions.BetaValue.ToString());

            Search.Start(Board, playerToMove, lSearchOptions, SearchMethodType, onCompletion);
        }
예제 #16
0
        protected override bool Update(Renderable renderItem, float delta)
        {
            if (_actions[0].Run(renderItem, delta))
            {
                _actions.RemoveAt(0);
            }

            if (_actions.Count > 0)
            {
                return(false);
            }

            OnCompletion?.Invoke(null);
            return(true);
        }
예제 #17
0
        public new void Initialize(GoBoard goBoard, Color playerToMove, SearchOptions searchOptions, OnCompletion onCompletion)
        {
            base.Initialize(goBoard, playerToMove, searchOptions, onCompletion);

            if (TranspositionTable == null)
                TranspositionTablePrimary = new TranspositionTablePlus(SearchOptions.TranspositionTableSize);
            else
                if (TranspositionTable.Size != SearchOptions.TranspositionTableSize)
                    TranspositionTablePrimary = new TranspositionTablePlus(SearchOptions.TranspositionTableSize);

            if (TranspositionTableEndGame == null)
                TranspositionTableEndGame = new TranspositionTablePlus(1024 * 1024);

            TranspositionTable = TranspositionTablePrimary;
        }
예제 #18
0
        protected override bool Update(Renderable renderItem, float delta)
        {
            for (var i = 0; i < _actions.Count; i++)
            {
                if (!_actions[i].Run(renderItem, delta))
                {
                    continue;
                }

                _actions.RemoveAt(i--);
            }

            if (_actions.Count > 0)
            {
                return(false);
            }

            OnCompletion?.Invoke(null);
            return(true);
        }
예제 #19
0
        /// <summary>
        ///     Retrieves the user profile with the given id.
        /// </summary>
        /// <remarks>
        ///     You have to be logged in with a valid token and the user needs to have access to the supplied profile. This means
        ///     the user owns it or it is public.
        /// </remarks>
        /// <param name="id">The profile's id</param>
        /// <param name="onCompletion">The completion handler returns whether the getting of the profile succeeded.
        /// The result is where the preferenceTerms are stored in. May be null on error.</param>
        internal bool GetProfile(string id, OnCompletion <PreferenceTerms> onCompletion)
        {
            if (id == null || id.Equals(""))
            {
                Debug.Log("Please supply all expected parameters");
                onCompletion(false, null);
                return(false);
            }

            if (_loginResponse?.Token == null)
            {
                Debug.Log("You need to login first!");
                onCompletion(false, null);
                return(false); // TODO remove
            }

            if (!_loginResponse.IsValid)
            {
                Debug.Log("Login has expired!");
                onCompletion(false, null);
                return(false); // TODO remove
            }

            _parent.StartChildCoroutine(_GetProfileCoroutine(id, response =>
            {
                _userContextResponse = JsonConvert.DeserializeObject <UserContextResponse>(response);

                onCompletion(true, new PreferenceTerms(_userContextResponse.UserPreferences.PreferenceTerms));
            }, message =>
            {
                Debug.Log("An error occured while getting user profile...");
                Debug.Log("Are you sure you are logged in with the right user? " + _loggedInUser + " is logged in.");
                Debug.Log(message);
                onCompletion(false, null);
            }));

            return(true); // TODO remove
        }
예제 #20
0
        public void Initialize(GoBoard goBoard, Color playerToMove, SearchOptions searchOptions, OnCompletion onCompletion)
        {
            lock (this)
            {
                SearchStatus           = new SearchStatus();
                SearchStatus.BoardSize = goBoard.BoardSize;
                Status = SearchStatusType.Thinking;
                UpdateStatus();
                UpdateStatusFlag = true;
                StopThinkingFlag = false;

                SearchOptions = searchOptions.Clone();
                NodesSearched = NodesEvaluated = 0;
                CheckSuperKo  = searchOptions.CheckSuperKo;
                OnCompletion  = onCompletion;

                SearchInterface.Initialize(goBoard, SearchOptions);

                Board = goBoard;

                PlayerToMove = playerToMove;
            }
        }
예제 #21
0
 public static extern void sendMessageToPeerWithOptions(string msg, string userId, SendMessageOptions options, OnCompletion callback);
예제 #22
0
 public static extern void logout(OnCompletion onDone);
예제 #23
0
 public static extern void sendMessageToPeer(string msg, string userId, OnCompletion onDone);
예제 #24
0
        public new void Initialize(GoBoard goBoard, Color playerToMove, SearchOptions searchOptions, OnCompletion onCompletion)
        {
            base.Initialize(goBoard, playerToMove, searchOptions, onCompletion);

            // setup distributed search coordinator & initialize workers
            if (NagCoordinator == null)
            {
                NagCoordinator = new NagCoordinator(9999, SearchOptions.PatternDetector.Patterns);                      // default port
            }
            NagCoordinator.SetNagCallBack(SetNag);
            NagCoordinator.Initialize(goBoard);

            if (TranspositionTable == null)
            {
                TranspositionTablePrimary = new TranspositionTablePlus(SearchOptions.TranspositionTableSize);
            }
            else
            if (TranspositionTable.Size != SearchOptions.TranspositionTableSize)
            {
                TranspositionTablePrimary = new TranspositionTablePlus(SearchOptions.TranspositionTableSize);
            }

            if (TranspositionTableEndGame == null)
            {
                TranspositionTableEndGame = new TranspositionTablePlus(1024 * 1024);
            }

            TranspositionTable = TranspositionTablePrimary;
        }
예제 #25
0
 public static extern void loginByToken(string token, string userId, OnCompletion onDone);
        public new void Initialize(GoBoard goBoard, Color playerToMove, SearchOptions searchOptions, OnCompletion onCompletion)
        {
            base.Initialize(goBoard, playerToMove, searchOptions, onCompletion);

            if (TranspositionTable == null)
            {
                TranspositionTablePrimary = new TranspositionTable(SearchOptions.TranspositionTableSize);
            }
            else
            if (TranspositionTable.Size != SearchOptions.TranspositionTableSize)
            {
                TranspositionTablePrimary = new TranspositionTable(SearchOptions.TranspositionTableSize);
            }

            if (TranspositionTableEndGame == null)
            {
                TranspositionTableEndGame = new TranspositionTable(1024 * 1024);
            }

            TranspositionTable = TranspositionTablePrimary;
        }
예제 #27
0
 protected override void CleanUp()
 {
     Data?.CompleteAdding();
     OnCompletion?.Invoke();
     NLogFinish();
 }
예제 #28
0
 public static extern string unsubscribePeersOnlineStatus(string[] peerIds, int count, OnCompletion callback);
예제 #29
0
 public void Wait()
 {
     TargetAction.Completion.Wait();
     OnCompletion?.Invoke();
     NLogFinish();
 }
예제 #30
0
 protected virtual void CleanUp()
 {
     OnCompletion?.Invoke();
     NLogFinish();
 }
예제 #31
0
 private void CleanUp()
 {
     CloseStreamsAction?.Invoke();
     OnCompletion?.Invoke();
     NLogFinish();
 }
예제 #32
0
        public void Initialize(GoBoard goBoard, Color playerToMove, SearchOptions searchOptions, OnCompletion onCompletion)
        {
            lock (this)
            {
                SearchStatus = new SearchStatus();
                SearchStatus.BoardSize = goBoard.BoardSize;
                Status = SearchStatusType.Thinking;
                UpdateStatus();
                UpdateStatusFlag = true;
                StopThinkingFlag = false;

                SearchOptions = searchOptions.Clone();
                NodesSearched = NodesEvaluated = 0;
                CheckSuperKo = searchOptions.CheckSuperKo;
                OnCompletion = onCompletion;

                SearchInterface.Initialize(goBoard, SearchOptions);

                Board = goBoard;

                PlayerToMove = playerToMove;
            }
        }
예제 #33
0
        public new void Initialize(GoBoard goBoard, Color playerToMove, SearchOptions searchOptions, OnCompletion onCompletion)
        {
            base.Initialize(goBoard, playerToMove, searchOptions, onCompletion);

            // setup distributed search coordinator & initialize workers
            if (NagCoordinator == null)
                NagCoordinator = new NagCoordinator(9999, SearchOptions.PatternDetector.Patterns);	// default port

            NagCoordinator.SetNagCallBack(SetNag);
            NagCoordinator.Initialize(goBoard);

            if (TranspositionTable == null)
                TranspositionTablePrimary = new TranspositionTablePlus(SearchOptions.TranspositionTableSize);
            else
                if (TranspositionTable.Size != SearchOptions.TranspositionTableSize)
                    TranspositionTablePrimary = new TranspositionTablePlus(SearchOptions.TranspositionTableSize);

            if (TranspositionTableEndGame == null)
                TranspositionTableEndGame = new TranspositionTablePlus(1024 * 1024);

            TranspositionTable = TranspositionTablePrimary;
        }
예제 #34
0
        public void Create( object masterView, bool scaleImage, RectangleF frame, OnCompletion onCompletion )
        {
            View = PlatformView.Create( );
            View.BackgroundColor = ControlStylingConfig.BackgroundColor;
            View.Frame = frame;
            View.AddAsSubview( masterView );

            Credits = new List<Credit>();
            Credits.Add( new Credit( "Hey you found me! I'm Jered, the mobile app developer here at CCV. Making this app was a ton of work, and couldn't have happened without the support of a ton of people!\n\nThanks so much to:\n" +
                "Jenni, my beautiful wife and very patient app tester!\n\n" +
                "Jon & David, for developing this app's backbone, Rock.\n\n" + 
                "Mason & Mike for testing, end points, and endless puns! (See what I did there?)\n\n" + 
                "Nick & Kyle for all the great artwork and design you see in this app.\n\n" +
                "Dan & Kris Simpson for HUGE feedback, testing, and movie nights!!\n\n" +
                "The IT boyz: Jim, `Stopher and Chris, for being extremely willing Android guinea pigs.\n\n" +
                "Matt, Emily, Robin, Jill and Bree, for their testing and feedback.\n\n\n" +
                "And thanks of course to all of you out there using the app and making CCV the awesome church that it is!", 
                "me.png", scaleImage, frame, View ) );


            CloseButton = PlatformButton.Create( );
            CloseButton.AddAsSubview( View.PlatformNativeObject );
            CloseButton.Text = "Got It!";
            CloseButton.BackgroundColor = PrayerConfig.PrayedForColor;
            CloseButton.TextColor = ControlStylingConfig.Button_TextColor;
            CloseButton.CornerRadius = ControlStylingConfig.Button_CornerRadius;
            CloseButton.SizeToFit( );
            CloseButton.ClickEvent = delegate(PlatformButton button) 
                {
                    OnCompletionCallback( );
                };

            OnCompletionCallback = onCompletion;
        }
예제 #35
0
        public void Create( object masterView, bool scaleImage, string imageName, RectangleF frame, OnCompletion onCompletion )
        {
            View = PlatformView.Create( );
            View.BackgroundColor = ControlStylingConfig.BackgroundColor;
            View.Frame = frame;
            View.AddAsSubview( masterView );

            MemoryStream logoStream = Rock.Mobile.IO.AssetConvert.AssetToStream( imageName );
            logoStream.Position = 0;
            PonyImage = PlatformImageView.Create( scaleImage );
            PonyImage.AddAsSubview( View.PlatformNativeObject );
            PonyImage.Image = logoStream;
            PonyImage.SizeToFit( );
            PonyImage.ImageScaleType = PlatformImageView.ScaleType.ScaleAspectFit;
            logoStream.Dispose( );

            CloseButton = PlatformButton.Create( );
            CloseButton.AddAsSubview( View.PlatformNativeObject );
            CloseButton.Text = "Prance! Dance! It's Magic Pony Time!";
            CloseButton.BackgroundColor = PrayerConfig.PrayedForColor;
            CloseButton.TextColor = ControlStylingConfig.Button_TextColor;
            CloseButton.CornerRadius = ControlStylingConfig.Button_CornerRadius;
            CloseButton.SizeToFit( );
            CloseButton.ClickEvent = delegate(PlatformButton button) 
                {
                    OnCompletionCallback( );
                };

            OnCompletionCallback = onCompletion;
        }
예제 #36
0
        public void Start(GoBoard goBoard, Color playerToMove, SearchOptions searchOptions, SearchMethodType searchMethodType, OnCompletion onCompletion)
        {
            // stop existing search, if any
            if (SearchInterface != null)
            {
                Stop();
            }

            if (SearchMethodType != searchMethodType)
            {
                SearchMethodType = searchMethodType;
                SearchInterface  = SearchMethodFactory.CreateFactory(searchMethodType);
            }

            // make a private copy of the board
            Board = goBoard.Clone();

            // make a private copy of the search options
            SearchOptions = searchOptions.Clone();

            // set player to move
            PlayerToMove = playerToMove;

            // set the Nag Coordinator
            SearchInterface.SetNagCoordinator(NagCoordinator);

            // initialize the search parameters
            SearchInterface.Initialize(Board, PlayerToMove, SearchOptions, onCompletion);

            // start search
            SearchThread = new Thread(this.StartThread);
            SearchThread.Start();
        }
예제 #37
0
 protected override void CleanUp()
 {
     CloseStreamsAction?.Invoke();
     OnCompletion?.Invoke();
     NLogFinish();
 }
예제 #38
0
        public void SimpleAsyncSearch(Color playerToMove, OnCompletion onCompletion)
        {
            SearchOptions lSearchOptions = GetSearchOptions(playerToMove);

            lSearchOptions.IncludeEndGameMoves = false;
            lSearchOptions.UsePatterns = false;

            Board.Dump();

            Console.Error.WriteLine("Move Search: ");
            Console.Error.WriteLine("Max Level: " + lSearchOptions.MaxPly.ToString() + " - Max Time: " + lSearchOptions.MaxSeconds.ToString() + " Alpha: " + lSearchOptions.AlphaValue.ToString() + " Beta: " + lSearchOptions.BetaValue.ToString());

            Search.Start(Board, playerToMove, lSearchOptions, SearchMethodType, onCompletion);
        }