예제 #1
0
    void Start()
    {
        Customizer c = GetComponent <Customizer> ();

        player1 = c.GetRandomData();
        player2 = c.GetRandomData();
    }
예제 #2
0
 public void TestInitialize()
 {
     customizer = new Customizer();
     Customizer.SetLocator(new SingleCustomizerLocator(customizer));
     Customizer.SetResolver(new DefaultTypeResolver());
     Initialize();
 }
예제 #3
0
 protected override void Initialize()
 {
     Customizer.SetResolver(new TypeResolver(Container));
     Context.Strategies.AddNew <CreationStrategy>(UnityBuildStage.PreCreation);
     Context.Strategies.AddNew <InitializationStrategy>(UnityBuildStage.Initialization);
     Context.Registering += Context_Registering;
 }
예제 #4
0
 public static void Register(Customizer <Address> customizer)
 {
     customizer
     .OverrideProtected <ProtectedAddressExtension, string, string>(
         method: a => a.SetValues(null, null),
         with: (a, country, city) => a.SetValues(country + "1", city + "2"))
     ;
 }
예제 #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldSetRequestSchemeToHttps()
        public virtual void ShouldSetRequestSchemeToHttps()
        {
            Customizer customizer = NewCustomizer();
            Request    request    = mock(typeof(Request));

            Customize(customizer, request);

            verify(request).Scheme = HTTPS.asString();
        }
예제 #6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldNotAddHstsHeaderWhenNotConfigured()
        public virtual void ShouldNotAddHstsHeaderWhenNotConfigured()
        {
            Customizer customizer = NewCustomizer();
            Request    request    = NewRequest();

            Customize(customizer, request);

            string hstsValue = request.Response.HttpFields.get(STRICT_TRANSPORT_SECURITY);

            assertNull(hstsValue);
        }
예제 #7
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldAddHstsHeaderWhenConfigured()
        public virtual void ShouldAddHstsHeaderWhenConfigured()
        {
            string     configuredValue = "max-age=3600; includeSubDomains";
            Customizer customizer      = NewCustomizer(configuredValue);
            Request    request         = NewRequest();

            Customize(customizer, request);

            string receivedValue = request.Response.HttpFields.get(STRICT_TRANSPORT_SECURITY);

            assertEquals(configuredValue, receivedValue);
        }
예제 #8
0
 public static IContainer Setup(IContainer container)
 {
     Customizer.SetResolver(new TypeResolver(container));
     foreach (var item in container.ComponentRegistry.Registrations.OfType <ComponentRegistration>())
     {
         if (!(item.Activator is InstanceActivator) && item.Activator.LimitType.IsClass && !item.Activator.LimitType.IsAbstract)
         {
             item.Activator = new InstanceActivator(item.Activator);
         }
     }
     return(container);
 }
예제 #9
0
    private void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
        }
        else if (Instance != this)
        {
            Destroy(this.gameObject);
        }

        DontDestroyOnLoad(this.gameObject);
    }
예제 #10
0
        public void Customize(Customizer <TBuilder> customizer)
        {
            if (customizer == null)
            {
                throw new ArgumentNullException(nameof(customizer));
            }

            base.Customize(valueProvider =>
            {
                var builderValueProvider = (BuilderValueProvider <T>)valueProvider;
                customizer.Invoke((TBuilder)builderValueProvider.Builder);
            });
        }
예제 #11
0
 /// <summary>
 /// Provides a safe way to delete the object from the game world.
 /// </summary>
 public void Dispose()
 {
     Customizer?.RemoveFromParent();
     foreach (var i in GetType().GetFields())
     {
         try
         {
             i.SetValue(this, default);
         }
         catch { }
     }
     Main.ObjectDragging = null;
     Main.Objects.Remove(this);
 }
예제 #12
0
파일: Data.cs 프로젝트: pontura/beldent
 void Awake()
 {
     if (!mInstance)
     {
         mInstance = this;
     }
     else
     {
         Destroy(this.gameObject);
         return;
     }
     customizer = GetComponent <Customizer> ();
     DontDestroyOnLoad(this.gameObject);
 }
    private void Awake()
    {
        if (DataPersistSystem.Instance != null && DataPersistSystem.Instance.Contains(ID))
        {
            GetSavedData();
        }

        wheelCustomizer.LoadData();
        wheelCustomizer.MoveNext();
        textureCustomizer.LoadData();
        textureCustomizer.MoveNext();
        engineCustomizer.LoadData();
        engineCustomizer.MoveNext();
        // colorCustomizer.LoadData();
        // colorCustomizer.MoveNext();
        fuelCustomizer.LoadData();
        fuelCustomizer.MoveNext();
        defaultCustomizer = wheelCustomizer;
    }
예제 #14
0
    private void Awake()
    {
        m_TanksNetwork  = FindObjectOfType <TanksNetworkManager>();
        m_Canvas        = GetComponentInChildren <Canvas>();
        m_Customizer    = GetComponentInChildren <Customizer>();
        m_Nicknamer     = GetComponentInChildren <Nicknamer>();
        m_MeshRenderers = GetComponentsInChildren <MeshRenderer>();

        m_Canvas.gameObject.SetActive(false);

        m_TankModel.SetActive(false);

        m_Camera.gameObject.SetActive(false);

        if (NetworkManager.IsSceneActive(m_TanksNetwork.onlineScene))
        {
            m_MatchRoomManager = GameObject.FindGameObjectWithTag("MatchRoomManager").GetComponent <MatchRoomManager>();
        }
    }
예제 #15
0
    // Use this for initialization
    void Start()
    {
        // Initialize gameOver sentinel value
        gameOver = false;

        // Grab the color customizer
        customizer = FindObjectOfType <Customizer>();

        // Set the board color
        foreach (Transform child in checkers.transform)
        {
            child.gameObject.GetComponent <SpriteRenderer>().color = customizer.checkerColor;
        }

        // Spawn the chess pieces and customize their properties
        SpawnAllPieces();

        // Set first blue selection to king
        Utilities.chessBoard[4, 1].handSelector.enabled = true;
        blueSelection = new Vector2Int(4, 1);
        SelectPiece(blueSelection.x, blueSelection.y, 1);

        // Set first red selection to king
        Utilities.chessBoard[4, 6].handSelector.enabled = true;
        redSelection = new Vector2Int(4, 6);
        SelectPiece(redSelection.x, redSelection.y, 2);

        // Enable start text
        startText.enabled = true;

        // Start the AI if it exists
        if (FindObjectOfType <StateController>() != null)
        {
            FindObjectOfType <StateController>().StartChessAI();
        }

        fadeIn.SetTrigger("fadeIn");

        // Trigger the start game after a short delay
        Invoke("StartGame", 1.5f);
        InputController.Instance.AssignBoardManager();
    }
예제 #16
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            return;
        }
        foreach (BodyParts b in allBodyParts)
        {
            if (b.nextBodyPart && b.previosBodyPart)
            {
                b.bodyParts[b.currentIndex].SetActive(true);
                b.nextBodyPart.onClick.AddListener(() => { ChangePart(b, true); });
                b.previosBodyPart.onClick.AddListener(() => { ChangePart(b, false); });
            }
        }

        foreach (FacialShapes fc in facialShapes)
        {
            if (fc.blendSlider)
            {
                fc.blendShapeText.text  = fc.blendShapeName;
                fc.blendSlider.maxValue = 100;
                fc.blendSlider.onValueChanged.AddListener((val) => { ChangeFacialStructure(fc.blendShapeName, val); });
            }
        }

        if (nextSuit && previosSuit && suitText)
        {
            nextSuit.onClick.AddListener(() => { ChangeSuit(true); });
            previosSuit.onClick.AddListener(() => { ChangeSuit(false); });
            suitText.text = allSuits[currentIndex].suitName;
        }

        if (saveButton)
        {
            saveButton.onClick.AddListener(() => { OnClickSaveButton(); });
        }
    }
    public void CustomizationType(int type)
    {
        switch (type)
        {
        case 0:
            defaultCustomizer = wheelCustomizer;
            break;

        case 1:
            defaultCustomizer = textureCustomizer;
            // defaultCustomizer = colorCustomizer;
            break;

        case 2:
            defaultCustomizer = fuelCustomizer;
            break;

        case 3:
            defaultCustomizer = engineCustomizer;
            break;
        }
    }
예제 #18
0
 private static void Customize(Customizer customizer, Request request)
 {
     customizer.customize(mock(typeof(Connector)), new HttpConfiguration(), request);
 }
예제 #19
0
        protected TSelf CustomizeChild <TProperty, TBuilder>(Child <TProperty, TBuilder, TResult> child, Customizer <TBuilder> customizer)
            where TBuilder : IBuilder <TProperty>
        {
            if (child == null)
            {
                throw new ArgumentNullException(nameof(child));
            }
            if (customizer == null)
            {
                throw new ArgumentNullException(nameof(customizer));
            }

            child.Customize(customizer);
            return((TSelf)this);
        }
예제 #20
0
        public static async Task Initialize(ProgressMonitor monitor)
        {
            // Already done in IdeSetup, but called again since unit tests don't use IdeSetup.
            DispatchService.Initialize();

            // Set initial run flags
            Counters.Initialization.Trace("Upgrading Settings");

            if (PropertyService.Get("MonoDevelop.Core.FirstRun", true))
            {
                isInitialRun = true;
                PropertyService.Set("MonoDevelop.Core.FirstRun", false);
                PropertyService.Set("MonoDevelop.Core.LastRunVersion", Runtime.Version.ToString());
                PropertyService.SaveProperties();
            }

            string lastVersionString = PropertyService.Get("MonoDevelop.Core.LastRunVersion", "1.0");

            Version.TryParse(lastVersionString, out var lastVersion);

            if (Runtime.Version > lastVersion && !isInitialRun)
            {
                isInitialRunAfterUpgrade = true;
                upgradedFromVersion      = lastVersion;
                PropertyService.Set("MonoDevelop.Core.LastRunVersion", Runtime.Version.ToString());
                PropertyService.SaveProperties();
            }

            Counters.Initialization.Trace("Initializing WelcomePage service");
            WelcomePage.WelcomePageService.Initialize().Ignore();

            Counters.Initialization.Trace("Creating Services");

            var serviceInitialization = Task.WhenAll(
                Runtime.GetService <DesktopService> (),
                Runtime.GetService <FontService> (),
                Runtime.GetService <TaskService> (),
                Runtime.GetService <ProjectOperations> (),
                Runtime.GetService <TextEditorService> (),
                Runtime.GetService <NavigationHistoryService> (),
                Runtime.GetService <DisplayBindingService> (),
                Runtime.GetService <RootWorkspace> (),
                Runtime.GetService <HelpOperations> (),
                Runtime.GetService <HelpService> ()
                );

            commandService = await Runtime.GetService <CommandManager> ();

            await serviceInitialization;

            Counters.Initialization.Trace("Creating Workbench");
            workbench = new Workbench();

            Counters.Initialization.Trace("Creating Root Workspace");

            CustomToolService.Init();

            FileService.ErrorHandler = FileServiceErrorHandler;

            monitor.BeginTask(GettextCatalog.GetString("Loading Workbench"), 3);

            // Before startup commands.
            Counters.Initialization.Trace("Running Pre-Startup Commands");
            AddinManager.AddExtensionNodeHandler("/MonoDevelop/Ide/PreStartupHandlers", OnExtensionChanged);
            monitor.Step(1);

            Counters.Initialization.Trace("Initializing Workbench");
            await workbench.Initialize(monitor);

            monitor.Step(1);

            Counters.Initialization.Trace("Realizing Workbench Window");
            workbench.Realize();
            monitor.Step(1);

            MessageService.RootWindow    = workbench.RootWindow;
            Xwt.MessageDialog.RootWindow = Xwt.Toolkit.CurrentEngine.WrapWindow(workbench.RootWindow);

            commandService.EnableIdleUpdate = true;

            if (Customizer != null)
            {
                Customizer.OnIdeInitialized();
            }

            monitor.EndTask();

            UpdateInstrumentationIcon();
            IdeApp.Preferences.EnableInstrumentation.Changed += delegate {
                UpdateInstrumentationIcon();
            };
            AutoTestService.Start(commandService, Preferences.EnableAutomatedTesting);
            AutoTestService.NotifyEvent("MonoDevelop.Ide.IdeStart");

            Gtk.LinkButton.SetUriHook((button, uri) => Xwt.Desktop.OpenUrl(uri));

            // Start initializing the type system service in the background
            Runtime.GetService <TypeSystemService> ().Ignore();

            // The ide is now initialized
            OnInitialized();
        }
예제 #21
0
 public TSelf Customize(Customizer <TSelf> customizer = null)
 {
     customizer?.Invoke((TSelf)this);
     return((TSelf)this);
 }
예제 #22
0
 public OrderBuilder WithContact(Customizer <ContactBuilder> customizer) => CustomizeChild(_contact, customizer);
예제 #23
0
        public ChildConfigurator <TBuilderResult, TValue, TValueBuilder, TConfigured> Customize(Customizer <TValueBuilder> customizer)
        {
            if (customizer == null)
            {
                throw new ArgumentNullException(nameof(customizer));
            }

            _customizers.Add(customizer);
            return(this);
        }
예제 #24
0
 public static void Register(Customizer <Customer> customizer)
 {
     customizer
     .OverrideProtected <ProtectedCustomerExtension, string>(c => c.GetMiddleName(), c => "van " + c.GetMiddleName())
     ;
 }
예제 #25
0
 protected override void ApplyCustomizer(TBuilder builder, Customizer <TBuilder> customizer)
 {
     customizer.Invoke(builder);
 }
예제 #26
0
 void Start()
 {
     player     = PlayerData.Instance;
     playerCust = Model.GetComponent <Customizer> ();
 }
예제 #27
0
파일: Ide.cs 프로젝트: seijikun/monodevelop
        public static void Initialize(IProgressMonitor monitor)
        {
            Counters.Initialization.Trace("Creating Workbench");
            workbench = new Workbench();
            Counters.Initialization.Trace("Creating Root Workspace");
            workspace = new RootWorkspace();
            Counters.Initialization.Trace("Creating Services");
            projectOperations = new ProjectOperations();
            helpOperations    = new HelpOperations();
            commandService    = new CommandManager();
            ideServices       = new IdeServices();
            CustomToolService.Init();
            AutoTestService.Start(commandService, Preferences.EnableAutomatedTesting);

            commandService.CommandTargetScanStarted  += CommandServiceCommandTargetScanStarted;
            commandService.CommandTargetScanFinished += CommandServiceCommandTargetScanFinished;
            commandService.KeyBindingFailed          += KeyBindingFailed;

            KeyBindingService.LoadBindingsFromExtensionPath("/MonoDevelop/Ide/KeyBindingSchemes");
            KeyBindingService.LoadCurrentBindings("MD2");

            commandService.CommandError += delegate(object sender, CommandErrorArgs args) {
                LoggingService.LogInternalError(args.ErrorMessage, args.Exception);
            };

            FileService.ErrorHandler = FileServiceErrorHandler;

            monitor.BeginTask(GettextCatalog.GetString("Loading Workbench"), 5);
            Counters.Initialization.Trace("Loading Commands");

            commandService.LoadCommands("/MonoDevelop/Ide/Commands");
            monitor.Step(1);

            Counters.Initialization.Trace("Initializing Workbench");
            workbench.Initialize(monitor);
            monitor.Step(1);

            InternalLog.EnableErrorNotification();

            MonoDevelop.Ide.WelcomePage.WelcomePageService.Initialize();
            MonoDevelop.Ide.WelcomePage.WelcomePageService.ShowWelcomePage();

            monitor.Step(1);

            Counters.Initialization.Trace("Restoring Workbench State");
            workbench.Show("SharpDevelop.Workbench.WorkbenchMemento");
            monitor.Step(1);

            Counters.Initialization.Trace("Flushing GUI events");
            DispatchService.RunPendingEvents();
            Counters.Initialization.Trace("Flushed GUI events");

            MessageService.RootWindow = workbench.RootWindow;

            commandService.EnableIdleUpdate = true;

            // Perser service initialization
            TypeSystemService.TrackFileChanges            = true;
            TypeSystemService.ParseProgressMonitorFactory = new ParseProgressMonitorFactory();

            Customizer.OnIdeInitialized();

            // Startup commands
            Counters.Initialization.Trace("Running Startup Commands");
            AddinManager.AddExtensionNodeHandler("/MonoDevelop/Ide/StartupHandlers", OnExtensionChanged);
            monitor.Step(1);
            monitor.EndTask();

            // Set initial run flags
            Counters.Initialization.Trace("Upgrading Settings");

            if (PropertyService.Get("MonoDevelop.Core.FirstRun", false))
            {
                isInitialRun = true;
                PropertyService.Set("MonoDevelop.Core.FirstRun", false);
                PropertyService.Set("MonoDevelop.Core.LastRunVersion", BuildInfo.Version);
                PropertyService.Set("MonoDevelop.Core.LastRunRevision", CurrentRevision);
                PropertyService.SaveProperties();
            }

            string lastVersion  = PropertyService.Get("MonoDevelop.Core.LastRunVersion", "1.9.1");
            int    lastRevision = PropertyService.Get("MonoDevelop.Core.LastRunRevision", 0);

            if (lastRevision != CurrentRevision && !isInitialRun)
            {
                isInitialRunAfterUpgrade = true;
                if (lastRevision == 0)
                {
                    switch (lastVersion)
                    {
                    case "1.0": lastRevision = 1; break;

                    case "2.0": lastRevision = 2; break;

                    case "2.2": lastRevision = 3; break;

                    case "2.2.1": lastRevision = 4; break;
                    }
                }
                upgradedFromRevision = lastRevision;
                PropertyService.Set("MonoDevelop.Core.LastRunVersion", BuildInfo.Version);
                PropertyService.Set("MonoDevelop.Core.LastRunRevision", CurrentRevision);
                PropertyService.SaveProperties();
            }

            // The ide is now initialized

            isInitialized = true;

            if (isInitialRun)
            {
                try {
                    OnInitialRun();
                } catch (Exception e) {
                    LoggingService.LogError("Error found while initializing the IDE", e);
                }
            }

            if (isInitialRunAfterUpgrade)
            {
                try {
                    OnUpgraded(upgradedFromRevision);
                } catch (Exception e) {
                    LoggingService.LogError("Error found while initializing the IDE", e);
                }
            }

            if (initializedEvent != null)
            {
                initializedEvent(null, EventArgs.Empty);
                initializedEvent = null;
            }

            //FIXME: we should really make this on-demand. consumers can display a "loading help cache" message like VS
            MonoDevelop.Projects.HelpService.AsyncInitialize();

            UpdateInstrumentationIcon();
            IdeApp.Preferences.EnableInstrumentationChanged += delegate {
                UpdateInstrumentationIcon();
            };
            AutoTestService.NotifyEvent("MonoDevelop.Ide.IdeStart");
        }
예제 #28
0
파일: Ide.cs 프로젝트: wzq0621/monodevelop
        internal static void Initialize(ProgressMonitor monitor, bool hideWelcomePage)
        {
            // Already done in IdeSetup, but called again since unit tests don't use IdeSetup.
            DispatchService.Initialize();

            Counters.Initialization.Trace("Creating Workbench");
            workbench = new Workbench();

            Counters.Initialization.Trace("Creating Root Workspace");
            workspace = new RootWorkspace();
            Counters.Initialization.Trace("Creating Services");
            projectOperations = new ProjectOperations();
            helpOperations    = new HelpOperations();
            commandService    = new CommandManager();
            ideServices       = new IdeServices();
            CustomToolService.Init();

            commandService.CommandTargetScanStarted  += CommandServiceCommandTargetScanStarted;
            commandService.CommandTargetScanFinished += CommandServiceCommandTargetScanFinished;
            commandService.KeyBindingFailed          += KeyBindingFailed;

            KeyBindingService.LoadBindingsFromExtensionPath("/MonoDevelop/Ide/KeyBindingSchemes");
            KeyBindingService.LoadCurrentBindings("MD2");

            commandService.CommandError += delegate(object sender, CommandErrorArgs args) {
                LoggingService.LogInternalError(args.ErrorMessage, args.Exception);
            };

            FileService.ErrorHandler = FileServiceErrorHandler;

            monitor.BeginTask(GettextCatalog.GetString("Loading Workbench"), 5);
            Counters.Initialization.Trace("Loading Commands");

            commandService.LoadCommands("/MonoDevelop/Ide/Commands");
            monitor.Step(1);

            // Before startup commands.
            Counters.Initialization.Trace("Running Pre-Startup Commands");
            AddinManager.AddExtensionNodeHandler("/MonoDevelop/Ide/PreStartupHandlers", OnExtensionChanged);
            monitor.Step(1);

            Counters.Initialization.Trace("Initializing Workbench");
            workbench.Initialize(monitor);
            monitor.Step(1);

            Counters.Initialization.Trace("Initializing WelcomePage service");
            MonoDevelop.Ide.WelcomePage.WelcomePageService.Initialize();
            monitor.Step(1);

            Counters.Initialization.Trace("Realizing Workbench Window");
            workbench.Realize("SharpDevelop.Workbench.WorkbenchMemento");
            monitor.Step(1);

            MessageService.RootWindow    = workbench.RootWindow;
            Xwt.MessageDialog.RootWindow = Xwt.Toolkit.CurrentEngine.WrapWindow(workbench.RootWindow);

            commandService.EnableIdleUpdate = true;

            if (Customizer != null)
            {
                Customizer.OnIdeInitialized(hideWelcomePage);
            }

            // Startup commands
            Counters.Initialization.Trace("Running Startup Commands");
            AddinManager.AddExtensionNodeHandler("/MonoDevelop/Ide/StartupHandlers", OnExtensionChanged);
            monitor.Step(1);
            monitor.EndTask();

            // Set initial run flags
            Counters.Initialization.Trace("Upgrading Settings");

            if (PropertyService.Get("MonoDevelop.Core.FirstRun", true))
            {
                isInitialRun = true;
                PropertyService.Set("MonoDevelop.Core.FirstRun", false);
                PropertyService.Set("MonoDevelop.Core.LastRunVersion", Runtime.Version.ToString());
                PropertyService.SaveProperties();
            }

            string lastVersionString = PropertyService.Get("MonoDevelop.Core.LastRunVersion", "1.0");

            Version.TryParse(lastVersionString, out var lastVersion);

            if (Runtime.Version > lastVersion && !isInitialRun)
            {
                isInitialRunAfterUpgrade = true;
                upgradedFromVersion      = lastVersion;
                PropertyService.Set("MonoDevelop.Core.LastRunVersion", Runtime.Version.ToString());
                PropertyService.SaveProperties();
            }

            // The ide is now initialized

            isInitialized = true;

            if (initializedEvent != null)
            {
                initializedEvent(null, EventArgs.Empty);
                initializedEvent = null;
            }

            //FIXME: we should really make this on-demand. consumers can display a "loading help cache" message like VS
            MonoDevelop.Projects.HelpService.AsyncInitialize();

            UpdateInstrumentationIcon();
            IdeApp.Preferences.EnableInstrumentation.Changed += delegate {
                UpdateInstrumentationIcon();
            };
            AutoTestService.Start(commandService, Preferences.EnableAutomatedTesting);
            AutoTestService.NotifyEvent("MonoDevelop.Ide.IdeStart");

            Gtk.LinkButton.SetUriHook((button, uri) => Xwt.Desktop.OpenUrl(uri));
        }