Esempio n. 1
0
 public void DisableKube(Kube kube)
 {
     KQueue.Enqueue(kube);
     Debug.Log($"Enqueuing... Kubes remaining in KQueue: {KQueue.Count}");
     kube.DeactivateKube();
     SetRemainingKubesText();
 }
Esempio n. 2
0
        public KubeServiceDiscoveryProviderTests()
        {
            _serviceName = "test";
            _namespaces  = "dev";
            _port        = 8001;
            _kubeHost    = "localhost";
            _fakekubeServiceDiscoveryUrl = $"http://{_kubeHost}:{_port}";
            _serviceEntries = new ServiceV1();
            _factory        = new Mock <IOcelotLoggerFactory>();

            var option = new KubeClientOptions
            {
                ApiEndPoint   = new Uri(_fakekubeServiceDiscoveryUrl),
                AccessToken   = "txpc696iUhbVoudg164r93CxDTrKRVWG",
                AuthStrategy  = KubeClient.KubeAuthStrategy.BearerToken,
                AllowInsecure = true
            };

            _clientFactory = KubeApiClient.Create(option);
            _logger        = new Mock <IOcelotLogger>();
            _factory.Setup(x => x.CreateLogger <Kube>()).Returns(_logger.Object);
            var config = new KubeRegistryConfiguration()
            {
                KeyOfServiceInK8s = _serviceName,
                KubeNamespace     = _namespaces
            };

            _provider = new Kube(config, _factory.Object, _clientFactory);
        }
Esempio n. 3
0
    private void SetStartingKube()
    {
        Kube startingKube = KQueue.Dequeue();

        startingKube.transform.position = Vector3.zero;
        startingKube.gameObject.SetActive(true);
        startingKube.SetKubeColor(colorPicker.startingColor);
    }
Esempio n. 4
0
 public void EnableKubeAtLocation(Vector3 location)
 {
     if (KQueue.Count > 0)
     {
         Kube kube = KQueue.Dequeue();
         kube.transform.position = location;
         kube.SetKubeColor(colorPicker.color);
         kube.gameObject.SetActive(true);
         Debug.Log($"Dequeuing with color {colorPicker.color}... Kubes remaining in KQueue: {KQueue.Count}");
         SetRemainingKubesText();
     }
 }
        static void Main(string[] args)
        {
            Console.WriteLine("\n2. Create a derived class\n------------------------------------");

            Kube aKube   = new Kube(3, 4, 5);
            int  kubeVol = aKube.findVolume();

            Console.WriteLine("Cuboid volume: {0}", kubeVol);

            Pyram aPyram = new Pyram(3, 4, 5);
            int   pyrVol = aPyram.findVolume();

            Console.WriteLine("Pyramid volume: {0}\n", pyrVol);
        }