예제 #1
0
파일: MyClassI.cs 프로젝트: bholl/zeroc-ice
 public override Dictionary<string, List<string>> opNDGSS(Dictionary<string, List<string>> i,
                                                          out Dictionary<string, List<string>> o,
                                                          Ice.Current current)
 {
     o = i;
     return i;
 }
예제 #2
0
        public void asyncRequestCanceled(OutgoingAsyncBase outAsync, Ice.LocalException ex)
        {
            lock(this)
            {
                if(_exception != null)
                {
                    return; // The request has been notified of a failure already.
                }

                if(!initialized())
                {
                    LinkedListNode<ProxyOutgoingAsyncBase> p = _requests.First;
                    while(p != null)
                    {
                        if(p.Value == outAsync)
                        {
                            _requests.Remove(p);
                            Ice.AsyncCallback cb = outAsync.completed(ex);
                            if(cb != null)
                            {
                                outAsync.invokeCompletedAsync(cb);
                            }
                            return;
                        }
                        p = p.Next;
                    }
                    Debug.Assert(false); // The request has to be queued if it timed out and we're not initialized yet.
                }
            }
            _connection.asyncRequestCanceled(outAsync, ex);
        }
예제 #3
0
    private void Revive()
    {
        //시체 남김
        GameObject mycorpse =
            (GameObject)Instantiate(Resources.Load("Prefab/InGameObject/Corpse"),
                                    currentPos.ToVector3(), Quaternion.identity, transform.parent);

        //시체 방향
        mycorpse.transform.Find("Sprite").GetComponent <SpriteRenderer>().flipX =
            transform.Find("Sprite").GetComponent <SpriteRenderer>().flipX;
        //영혼
        GameObject spiritpref = Resources.Load <GameObject>("Prefab/InGameObject/Spirit");
        GameObject spirit     = Instantiate(spiritpref, currentPos.ToVector3(), Quaternion.identity);
        GameObject debrispref = Resources.Load <GameObject>("Prefab/InGameObject/Debris");

        Instantiate(debrispref, currentPos.ToVector3(), Quaternion.identity);
        spirit.GetComponent <Spirit>().InitSetting(GenPoint.ActivatingGenPoint.CurrentPos.ToVector3(), respawnDelayTime);
        //gen point 에서 다시 살아남
        Position lastPos  = currentPos;
        Ice      underIce = (Ice)MapManager.instance.Find(typeof(Ice), currentPos);

        Respawn();
        StopCoroutine(MoveCoroutine());
        if (isMoving && underIce != null)//움직이는 중이고 밑에 얼음 있음
        {
            mycorpse.GetComponent <Corpse>().Slide(lastPos + moveDir, true);
            //mycorpse.GetComponent<Corpse>().Move(lastPos + MoveDir, true);
        }
    }
예제 #4
0
    public override Ice.DispatchStatus dispatch(Ice.Request request)
    {
        Ice.Current current = request.getCurrent();
        lastOperation_ = current.operation;

        if(lastOperation_.Equals("addWithRetry"))
        {
            for(int i = 0; i < 10; ++i)
            {
                try
                {
                    servant_.ice_dispatch(request);
                    test(false);
                }
                catch(Test.RetryException)
                {
                    //
                    // Expected, retry
                    //
                }
            }

            current.ctx["retry"] = "no";
        }

        lastStatus_ = servant_.ice_dispatch(request);
        return lastStatus_;
    }
예제 #5
0
    public void GenerateCubes()
    {
        for (int x = 0; x < worldWidth; x++)
        {
            for (int y = 0; y < worldHeight; y++)
            {
                for (int z = 0; z < worldWidth; z++)
                {
                    if (cubeDatas[x, y, z] != null)
                    {
                        if (cubeDatas[x, y, z].cubeType == CubeType.Stone)
                        {
                            cubes[x, y, z] = new Stone(new Vector3(x, y, z), world);
                        }
                        else if (cubeDatas[x, y, z].cubeType == CubeType.Sand)
                        {
                            cubes[x, y, z] = new Sand(new Vector3(x, y, z), world);
                        }
                        else if (cubeDatas[x, y, z].cubeType == CubeType.Ice)
                        {
                            cubes[x, y, z] = new Ice(new Vector3(x, y, z), world);
                        }

                        cubeCount++;
                    }
                }
            }
        }
    }
예제 #6
0
파일: Client.cs 프로젝트: pedia/zeroc-ice
    private static int run(string[] args, Ice.Communicator communicator)
    {
        System.Collections.Generic.List<int> ports = new System.Collections.Generic.List<int>();
        for(int i = 0; i < args.Length; i++)
        {
            int port = 0;
            try
            {
                port = System.Int32.Parse(args[i]);
            }
            catch(System.FormatException ex)
            {
                System.Console.Error.WriteLine(ex);
                return 1;
            }
            ports.Add(port);
        }

        if(ports.Count == 0)
        {
            System.Console.Error.WriteLine("Client: no ports specified");
            usage();
            return 1;
        }

        AllTests.allTests(communicator, ports);
        return 0;
    }
예제 #7
0
 public RemoteObjectAdapterI(Ice.ObjectAdapter adapter)
 {
     _adapter = adapter;
     _testIntf = TestIntfPrxHelper.uncheckedCast(_adapter.add(new TestI(),
                                                 Ice.Util.stringToIdentity("test")));
     _adapter.activate();
 }
예제 #8
0
파일: TimeoutI.cs 프로젝트: Crysty-Yui/ice
 public override void holdAdapter(int to, Ice.Current current)
 {
     current.adapter.hold();
     ActivateAdapterThread act = new ActivateAdapterThread(current.adapter, to);
     Thread thread = new Thread(new ThreadStart(act.run));
     thread.Start();
 }
예제 #9
0
    public override void pingBiDir(Ice.Identity id, Ice.Current current)
    {
        try
        {
            //
            // Ensure sending too much data doesn't cause the UDP connection
            // to be closed.
            //
            try
            {
                byte[] seq = new byte[32 * 1024];
                Test.TestIntfPrxHelper.uncheckedCast(current.con.createProxy(id)).sendByteSeq(seq, null);
            }
            catch(Ice.DatagramLimitException)
            {
                // Expected.
            }

            Test.PingReplyPrxHelper.uncheckedCast(current.con.createProxy(id)).reply();
        }
        catch(Ice.LocalException)
        {
            Debug.Assert(false);
        }
    }
    public void ClearWeather()
    {
        var emission = rainPS.emission;

        emission.enabled = false;

        var snowEmission = snowPS.emission;

        snowEmission.enabled = false;

        var heatEmission = heatPS.emission;

        heatEmission.enabled = false;

        var dangerEmission = heatDangerPS.emission;

        dangerEmission.enabled = false;

        iceGO.SetActive(false);
        Ice.ResetAllPlayersDrag();

        heatHazardGO.SetActive(false);

        fireDangerIntensityTarget = 0;
        heatDangerLight.enabled   = false;
    }
예제 #11
0
    public void SetCube(Vector3 pos, CubeType type)
    {
        int x = (int)pos.x;
        int y = (int)pos.y;
        int z = (int)pos.z;

        if (OutOfBound(x, y, z))
        {
            return;
        }

        if (type == CubeType.Stone)
        {
            cubes[x, y, z] = new Stone(pos, world);
        }
        else if (type == CubeType.Sand)
        {
            cubes[x, y, z] = new Sand(pos, world);
        }
        else if (type == CubeType.Ice)
        {
            cubes[x, y, z] = new Ice(pos, world);
        }
        else if (type == CubeType.Mud)
        {
            cubes[x, y, z] = new Mud(pos, world);
        }
        else if (type == CubeType.Cloud)
        {
            cubes[x, y, z] = new Cloud(pos, world);
        }
    }
예제 #12
0
        public void Checking_UseStock_Expected_Return9()
        {
            //Arrange
            Inventory inventory = new Inventory();
            Recipe    recipe    = new Recipe();
            Lemons    lemons    = new Lemons();
            Sugar     sugar     = new Sugar();
            Ice       ice       = new Ice();
            int       expected  = 12;

            lemons.ItemCount = 12;
            sugar.ItemCount  = 12;
            ice.ItemCount    = 12;
            recipe.lem       = 3;
            recipe.sug       = 3;
            recipe.ice       = 3;
            int expectedLemonResult = lemons.ItemCount - recipe.lem;
            int expectedSugarResult = sugar.ItemCount - recipe.sug;
            int expectedIceResult   = ice.ItemCount - recipe.ice;



            //Act
            inventory.UseStock();


            //Assert
            Assert.AreEqual(expected, lemons.ItemCount);
        }
예제 #13
0
        public bool addProxy(Ice.ObjectPrx proxy, AddProxyCallback callback)
        {
            Debug.Assert(proxy != null);
            lock(this)
            {
                if(_identities.Contains(proxy.ice_getIdentity()))
                {
                    //
                    // Only add the proxy to the router if it's not already in our local map.
                    //
                    return true;
                }
            }
            _router.begin_addProxies(new Ice.ObjectPrx[] { proxy }).whenCompleted(
                (Ice.ObjectPrx[] evictedProxies) =>
                {
                    addAndEvictProxies(proxy, evictedProxies);
                    callback.addedProxy();
                },
                (Ice.Exception ex) =>
                {
                    Debug.Assert(ex is Ice.LocalException);
                    callback.setException((Ice.LocalException)ex);
                });

            return false;
        }
예제 #14
0
파일: MyClassI.cs 프로젝트: bholl/zeroc-ice
 public override Dictionary<string, CSS> opNDCSS(Dictionary<string, CSS> i,
                                                 out Dictionary<string, CSS> o,
                                                 Ice.Current current)
 {
     o = i;
     return i;
 }
예제 #15
0
 public override void ice_exception(Ice.Exception ex)
 {
     if (callback != null)
     {
         callback(new Result<bool>(ex));
     }
 }
예제 #16
0
    static void Main(string[] args)
    {
        int t = Convert.ToInt32(Console.ReadLine());

        for (int a0 = 0; a0 < t; a0++)
        {
            int      m      = Convert.ToInt32(Console.ReadLine());
            int      n      = Convert.ToInt32(Console.ReadLine());
            string[] a_temp = Console.ReadLine().Split(' ');
            int[]    a      = Array.ConvertAll(a_temp, e => int.Parse(e));

            Ice[] iceCream = new Ice[n];
            for (int i = 0; i < n; i++)
            {
                iceCream[i] = new Ice(a[i], i + 1);
            }

            Quicksort(iceCream, 0, n - 1);

            for (int i = 0; i < n; i++)
            {
                int complemento = m - iceCream[i].costo;

                int indiceComplemento = BinarySearch(iceCream, i + 1, iceCream.Length - 1, complemento);

                if (indiceComplemento != -1)
                {
                    Console.WriteLine(Math.Min(iceCream[i].indice, iceCream[indiceComplemento].indice) + " "
                                      + Math.Max(iceCream[i].indice, iceCream[indiceComplemento].indice));
                    break;
                }
            }
        }
        Console.ReadLine();
    }
 public override float getStatistics(Ferda.Modules.AbstractQuantifierSetting quantifierSetting, Ice.Current current__)
 {
     //a(a+b+c+d)/((a+b)(a+c))- 1
     return
         (float)(
              quantifierSetting.secondContingencyTableRows[0][0] *
             (
                 quantifierSetting.secondContingencyTableRows[0][0] +
                 quantifierSetting.secondContingencyTableRows[0][1] +
                 quantifierSetting.secondContingencyTableRows[1][0] +
                 quantifierSetting.secondContingencyTableRows[1][1]
             )
         )
         /
         (float)((
             (
             quantifierSetting.secondContingencyTableRows[0][0] +
             quantifierSetting.secondContingencyTableRows[0][1]
             )
             *
             (
             quantifierSetting.secondContingencyTableRows[0][0] +
             quantifierSetting.secondContingencyTableRows[1][0]
             )
         ) - 1);
 }
예제 #18
0
파일: Client.cs 프로젝트: Crysty-Yui/ice
    private static int run(string[] args, Ice.Communicator communicator)
    {
        communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010:udp");
        Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
        adapter.add(new decimalI(), communicator.stringToIdentity("test"));
        adapter.add(new Test1I(), communicator.stringToIdentity("test1"));
        adapter.add(new Test2I(), communicator.stringToIdentity("test2"));
        adapter.activate();

        Console.Out.Write("testing operation name... ");
        Console.Out.Flush();
        @abstract.@decimalPrx p = @[email protected](
            adapter.createProxy(communicator.stringToIdentity("test")));
        p.@default();
        Console.Out.WriteLine("ok");

        Console.Out.Write("testing System as module name... ");
        Console.Out.Flush();
        @abstract.System.TestPrx t1 = @abstract.System.TestPrxHelper.uncheckedCast(
                adapter.createProxy(communicator.stringToIdentity("test1")));
        t1.op();

        System.TestPrx t2 = System.TestPrxHelper.uncheckedCast(
                adapter.createProxy(communicator.stringToIdentity("test2")));

        t2.op();
        Console.Out.WriteLine("ok");

        Console.Out.Write("testing types... ");
        Console.Out.Flush();
        testtypes();
        Console.Out.WriteLine("ok");

        return 0;
    }
예제 #19
0
 public override Dictionary<string, Dictionary<int, int>> opNDV(Dictionary<string, Dictionary<int, int>> i,
                                                                out Dictionary<string, Dictionary<int, int>> o,
                                                                Ice.Current current)
 {
     o = i;
     return i;
 }
예제 #20
0
파일: Server.cs 프로젝트: joshmoore/ice
    private static int run(string[] args, Ice.Communicator communicator,
        Ice.InitializationData initData)
    {
        //
        // Register the server manager. The server manager creates a new
        // 'server' (a server isn't a different process, it's just a new
        // communicator and object adapter).
        //
        Ice.Properties properties = communicator.getProperties();
        properties.setProperty("Ice.ThreadPool.Server.Size", "2");
        properties.setProperty("ServerManagerAdapter.Endpoints", "default -p 12010:udp");

        Ice.ObjectAdapter adapter = communicator.createObjectAdapter("ServerManagerAdapter");

        //
        // We also register a sample server locator which implements the
        // locator interface, this locator is used by the clients and the
        // 'servers' created with the server manager interface.
        //
        ServerLocatorRegistry registry = new ServerLocatorRegistry();
        Ice.Object @object = new ServerManagerI(registry, initData);
        adapter.add(@object, communicator.stringToIdentity("ServerManager"));
        registry.addObject(adapter.createProxy(communicator.stringToIdentity("ServerManager")));
        Ice.LocatorRegistryPrx registryPrx = Ice.LocatorRegistryPrxHelper.uncheckedCast(
                                                adapter.add(registry, communicator.stringToIdentity("registry")));

        ServerLocator locator = new ServerLocator(registry, registryPrx);
        adapter.add(locator, communicator.stringToIdentity("locator"));

        adapter.activate();
        communicator.waitForShutdown();

        return 0;
    }
예제 #21
0
 public override float getStatistics(Ferda.Modules.AbstractQuantifierSetting quantifierSetting, Ice.Current current__)
 {
     //Differences between EConfidence (a+d)/(a+b+c+d)
     return
         ((float)(
         quantifierSetting.firstContingencyTableRows[0][0] +
         quantifierSetting.firstContingencyTableRows[1][1]
         )
         /
         (float)(
         quantifierSetting.firstContingencyTableRows[0][0] +
         quantifierSetting.firstContingencyTableRows[0][1] +
         quantifierSetting.firstContingencyTableRows[1][0] +
         quantifierSetting.firstContingencyTableRows[1][1]
         ))
         -
         ((float)(
         quantifierSetting.secondContingencyTableRows[0][0] +
         quantifierSetting.secondContingencyTableRows[1][1]
         )
         /
         (float)(
         quantifierSetting.secondContingencyTableRows[0][0] +
         quantifierSetting.secondContingencyTableRows[0][1] +
         quantifierSetting.secondContingencyTableRows[1][0] +
         quantifierSetting.secondContingencyTableRows[1][1]
         ))
         ;
 }
예제 #22
0
        private void load()
        {
            fire = new Fire
            {
                Anchor = Anchor.Centre,
                Origin = Anchor.Centre,
                Size   = new Vector2(size),
            };
            ice = new Ice
            {
                Anchor = Anchor.Centre,
                Origin = Anchor.Centre,
                Size   = new Vector2(size),
            };

            Container = InternalChild = new Container
            {
                AutoSizeAxes = Axes.Both,
                Anchor       = Anchor.Centre,
                Origin       = Anchor.Centre,
                Masking      = true,
                Children     = new Drawable[]
                {
                    ice,
                    fire
                }
            };
        }
예제 #23
0
        public virtual void Setup()
        {
            Character MagicGladiador = new Gladiador("MagicGladiador");
            Character KingTroll      = new Troll("KingTroll");
            Character QueenElf       = new Elf("QueenElf");
            Character MagicWizard    = new Wizard("MagicWizard");
            IItem     PinkyBow       = new BowAndArrow();
            IItem     IcedCup        = new Ice();

            QueenElf.AddItem(IcedCup);
            QueenElf.AddItem(PinkyBow);
            IItem Blade = new LightSaber();
            IItem Axe   = new FireAx();

            KingTroll.AddItem(Blade);
            KingTroll.AddItem(Axe);
            IItem Saber    = new LightSaber();
            IItem BlueRobe = new Robes();

            MagicWizard.AddItem(Saber);
            MagicWizard.AddItem(Blade);
            IItem            ChainArmor = new CompleteArmor();
            InfiniteGauntlet Gauntlet   = new InfiniteGauntlet();

            Gauntlet.AddStone();
            MagicGladiador.AddItem(ChainArmor);
            MagicGladiador.AddItem(Gauntlet);
            characters.Add(MagicGladiador);
            characters.Add(KingTroll);
            characters.Add(QueenElf);
            characters.Add(MagicWizard);
        }
예제 #24
0
파일: Server.cs 프로젝트: joshmoore/ice
    public static int run(string[] args, Ice.Communicator communicator, TextWriter @out)
    {
        //
        // When running as a MIDlet the properties for the server may be
        // overridden by configuration. If it isn't then we assume
        // defaults.
        //
        if(communicator.getProperties().getProperty("TestAdapter.Endpoints").Length == 0)
        {
            communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010");
        }
        if(communicator.getProperties().getProperty("ControllerAdapter.Endpoints").Length == 0)
        {
            communicator.getProperties().setProperty("ControllerAdapter.Endpoints", "tcp -p 12011");
            communicator.getProperties().setProperty("ControllerAdapter.ThreadPool.Size", "1");
        }

        Ice.ObjectAdapter adapter = communicator.createObjectAdapter("TestAdapter");
        Ice.ObjectAdapter adapter2 = communicator.createObjectAdapter("ControllerAdapter");

        BackgroundControllerI backgroundController = new BackgroundControllerI(adapter);

        adapter.add(new BackgroundI(backgroundController), communicator.stringToIdentity("background"));
        adapter.add(new LocatorI(backgroundController), communicator.stringToIdentity("locator"));
        adapter.add(new RouterI(backgroundController), communicator.stringToIdentity("router"));
        adapter.activate();

        adapter2.add(backgroundController, communicator.stringToIdentity("backgroundController"));
        adapter2.activate();

        communicator.waitForShutdown();
        return 0;
    }
예제 #25
0
파일: Server.cs 프로젝트: joshmoore/ice
 public override void findAdapterById_async(Ice.AMD_Locator_findAdapterById response, string adapter,
                                            Ice.Current current)
 {
     _controller.checkCallPause(current);
     Ice.Communicator communicator = current.adapter.getCommunicator();
     response.ice_response(current.adapter.createDirectProxy(communicator.stringToIdentity("dummy")));
 }
예제 #26
0
    public Ice.Object locate(Ice.Current current, out System.Object cookie)
    {
        lock(this)
        {
            test(!_deactivated);
        }

        test(current.id.category.Equals(_category) || _category.Length == 0);

        if(current.id.name.Equals("unknown"))
        {
            cookie = null;
            return null;
        }

        test(current.id.name.Equals("locate") || current.id.name.Equals("finished"));
        if(current.id.name.Equals("locate"))
        {
            exception(current);
        }

        //
        // Ensure locate() is only called once per request.
        //
        test(_requestId == -1);
        _requestId = current.requestId;

        cookie = new CookieI();

        return new TestI();
    }
예제 #27
0
 //
 // Only for use by Instance.
 //
 internal ObjectAdapterFactory(Instance instance, Ice.Communicator communicator)
 {
     instance_ = instance;
     _communicator = communicator;
     _adapterNamesInUse = new HashSet<string>();
     _adapters = new List<Ice.ObjectAdapterI>();
 }
예제 #28
0
        public Ice.ObjectAdapter createObjectAdapter(string name, Ice.RouterPrx router)
        {
            lock(this)
            {
                if(instance_ == null)
                {
                    throw new Ice.CommunicatorDestroyedException();
                }

                Ice.ObjectAdapterI adapter = null;
                if(name.Length == 0)
                {
                    string uuid = System.Guid.NewGuid().ToString();
                    adapter = new Ice.ObjectAdapterI(instance_, _communicator, this, uuid, null, true);
                }
                else
                {
                    if(_adapterNamesInUse.Contains(name))
                    {
                        Ice.AlreadyRegisteredException ex = new Ice.AlreadyRegisteredException();
                        ex.kindOfObject = "object adapter";
                        ex.id = name;
                        throw ex;
                    }
                    adapter = new Ice.ObjectAdapterI(instance_, _communicator, this, name, router, false);
                    _adapterNamesInUse.Add(name);
                }
                _adapters.Add(adapter);
                return adapter;
            }
        }
예제 #29
0
 /// <summary>
 /// Creates a Glacier2 session.
 /// </summary>
 /// <param name="callback">The callback for notifications about session
 /// establishment.</param>
 /// <param name="initData">The Ice.InitializationData for initializing
 /// the communicator.</param>
 /// <param name="finderStr">The stringified Ice.RouterFinder proxy.</param>
 /// <param name="useCallbacks">True if the session should create an object adapter for receiving callbacks.</param>
 public SessionHelper(SessionCallback callback, Ice.InitializationData initData, string finderStr, bool useCallbacks)
 {
     _callback = callback;
     _initData = initData;
     _finderStr = finderStr;
     _useCallbacks = useCallbacks;
 }
예제 #30
0
파일: TestI.cs 프로젝트: joshmoore/ice
 opBatchCount(Ice.Current current)
 {
     lock(this)
     {
         return _batchCount;
     }
 }
예제 #31
0
 getConnectionObserver(Ice.ConnectionInfo ci, 
                       Ice.Endpoint ei, 
                       Ice.Instrumentation.ConnectionState s,
                       Ice.Instrumentation.ConnectionObserver o)
 {
     return null;
 }
예제 #32
0
 public ConnectionRequestHandler(Reference @ref, Ice.ConnectionI connection, bool compress)
 {
     _reference = @ref;
     _response = _reference.getMode() == Reference.Mode.ModeTwoway;
     _connection = connection;
     _compress = compress;
 }
예제 #33
0
 public ServiceManagerI(Ice.Communicator communicator, string[] args)
 {
     _communicator = communicator;
     _logger = _communicator.getLogger();
     _argv = args;
     _traceServiceObserver = _communicator.getProperties().getPropertyAsInt("IceBox.Trace.ServiceObserver");
 }
예제 #34
0
파일: HoldI.cs 프로젝트: pedia/zeroc-ice
 putOnHold(int milliSeconds, Ice.Current current)
 {
     if(milliSeconds < 0)
     {
         _adapter.hold();
     }
     else if(milliSeconds == 0)
     {
         _adapter.hold();
         _adapter.activate();
     }
     else
     {
         _timer.schedule(() =>
         {
             try
             {
                 putOnHold(0, null);
             }
             catch(Ice.ObjectAdapterDeactivatedException)
             {
             }
         }, milliSeconds);
     }
 }
예제 #35
0
파일: Game.cs 프로젝트: BVaflick/gemtd
    public static Ice SpawnIce()
    {
        Ice ice = instance.warFactory.Ice;

        // instance.nonEnemies.Add(slow);
        return(ice);
    }
예제 #36
0
 public void ResetBuffer(PieceState s)
 {
     if (twine != null)
     {
         twine.ShutDown();
         twine = null;
     }
     if (ice != null)
     {
         ice.ShutDown();
         ice = null;
     }
     if (coke)
     {
         coke = false;
         new TurnColor().Init(this.gameObject, .2f, defaultColor, null);
     }
     if (clock != null)
     {
         if (s == PieceState.Coke && !clock.triggered)
         {
             clock.Shake();
         }
         else
         {
             clock.ShutDown();
             clock = null;
         }
     }
 }
예제 #37
0
        protected override void Awake()
        {
            base.Awake();

            Astral.onClick.AddListener(OnAstralClick);
            Darkness.onClick.AddListener(OnDarknessClick);
            Ice.onClick.AddListener(OnIceClick);
            Iron.onClick.AddListener(OnIronClick);
            Storm.onClick.AddListener(OnStormClick);
            Nature.onClick.AddListener(OnNatureClick);
            Fire.onClick.AddListener(OnFireClick);

            astralLevel   = Astral.GetComponentInChildren <TextMeshProUGUI>();
            darknessLevel = Darkness.GetComponentInChildren <TextMeshProUGUI>();
            iceLevel      = Ice.GetComponentInChildren <TextMeshProUGUI>();
            ironLevel     = Iron.GetComponentInChildren <TextMeshProUGUI>();
            stormLevel    = Storm.GetComponentInChildren <TextMeshProUGUI>();
            natureLevel   = Nature.GetComponentInChildren <TextMeshProUGUI>();
            fireLevel     = Fire.GetComponentInChildren <TextMeshProUGUI>();

            void OnAstralClick() => Owner.ElementSystem.LearnElement((int)ElementType.Astral);
            void OnDarknessClick() => Owner.ElementSystem.LearnElement((int)ElementType.Darkness);
            void OnIceClick() => Owner.ElementSystem.LearnElement((int)ElementType.Ice);
            void OnIronClick() => Owner.ElementSystem.LearnElement((int)ElementType.Iron);
            void OnStormClick() => Owner.ElementSystem.LearnElement((int)ElementType.Storm);
            void OnNatureClick() => Owner.ElementSystem.LearnElement((int)ElementType.Nature);
            void OnFireClick() => Owner.ElementSystem.LearnElement((int)ElementType.Fire);

            Buttons = new Button[] { Astral, Darkness, Ice, Iron, Storm, Nature, Fire };
        }
예제 #38
0
    public static Test.MyClassPrx allTests(Ice.Communicator communicator, bool collocated)
#endif
    {
#if SILVERLIGHT
        bool collocated = false;
#endif
        Flush();
        string rf = "test:default -p 12010";
        Ice.ObjectPrx baseProxy = communicator.stringToProxy(rf);
        Test.MyClassPrx cl = Test.MyClassPrxHelper.checkedCast(baseProxy);

        Write("testing twoway operations... ");
        Flush();
        Twoways.twoways(communicator, cl);
        WriteLine("ok");

        if(!collocated)
        {
            Write("testing twoway operations with AMI... ");
            Flush();
            TwowaysAMI.twowaysAMI(communicator, cl);
            WriteLine("ok");

            Write("testing twoway operations with new AMI mapping... ");
            Flush();
            TwowaysNewAMI.twowaysAMI(communicator, cl);
            WriteLine("ok");
        }
#if SILVERLIGHT
        cl.shutdown();
#else
        return cl;
#endif
    }
예제 #39
0
파일: MyClassI.cs 프로젝트: bholl/zeroc-ice
 public override Dictionary<string, int[]> opNDAIS(Dictionary<string, int[]> i,
                                                   out Dictionary<string, int[]> o,
                                                   Ice.Current current)
 {
     o = i;
     return i;
 }
예제 #40
0
 /// <summary>
 /// Start the pinger. It runs in a thread and returns the average response time.
 /// </summary>
 /// <param name="session">Session to ping. Note that this cannot be a UDP or
 /// one-way session, because it requires a response from the server to be
 /// effective.</param>
 public Pinger(Ice.ObjectPrx _session)
 {
     session = _session;
     Running = true;
     internalThread = new Thread(new ThreadStart(Run));
     internalThread.Start();
 }
예제 #41
0
 public override void getAll(out B b1, out B b2, out C c, out D d, Ice.Current current)
 {
     b1 = _b1;
     b2 = _b2;
     c = _c;
     d = _d;
 }
예제 #42
0
        public Mamoswine(double health, string status)
        {
            name  = "Mamoswine";
            type1 = new Ice();
            type2 = new Ground();

            estimatedSpeed = 309; estimatedHealth = 309; estimatedAttack = 309; estimatedDefense = 309; estimatedSpAttk = 309; estimatedSpDef = 309; move1 = new Flamethrower(); move2 = new Flamethrower(); move3 = new Flamethrower(); move4 = new Flamethrower(); Initialize(name, health, status);
        }
예제 #43
0
        public Cloyster(double health, string status)
        {
            name  = "Cloyster";
            type1 = new Water();
            type2 = new Ice();

            estimatedSpeed = 309; estimatedHealth = 309; estimatedAttack = 309; estimatedDefense = 309; estimatedSpAttk = 309; estimatedSpDef = 309; move1 = new Flamethrower(); move2 = new Flamethrower(); move3 = new Flamethrower(); move4 = new Flamethrower(); Initialize(name, health, status);
        }
예제 #44
0
 public Inventory()
 {
     lemons  = new Lemons();
     ice     = new Ice();
     sugar   = new Sugar();
     pitcher = new Pitcher();
     cups    = new Cups();
 }
예제 #45
0
    public void Freeze()
    {
        present = false;
        Ice ice   = new Ice(targetBody, vitality);
        int index = targetBody.GetLayerVal(this);

        targetBody.AddAffecter(ice);
        targetBody.AddToLayerList(ice, index);
    }
예제 #46
0
            public static Meltable FromIce(Ice ice)
            {
                var meltable = new Meltable();

                meltable.temperature = ice.MeltTemperature;
                meltable.pressure    = ice.MeltPressure * RocketMath.Thousand;

                return(meltable);
            }
예제 #47
0
        private void PopulateState(BaseItem item)
        {
            if (item is Empty empty)
            {
                EmptyItems.Add(empty);
                return;
            }

            if (item is AiTank aiTank)
            {
                AiTanks.Add(aiTank);

                if (item is AiPrizeTank aiPrizeTank)
                {
                    AiPrizeTanks.Add(aiPrizeTank);
                }

                return;
            }

            if (item is EnemyTank enemyTank)
            {
                EnemyTanks.Add(enemyTank);
                return;
            }

            if (item is MyTank myTank)
            {
                MyTank = myTank;
                return;
            }

            if (item is Bullet bullet)
            {
                Bullets.Add(bullet);
                return;
            }

            if (item is River river)
            {
                Rivers.Add(river);
                return;
            }

            if (item is Tree tree)
            {
                Trees.Add(tree);
                return;
            }

            if (item is Ice ice)
            {
                Ice.Add(ice);
                return;
            }
        }
예제 #48
0
    void Start()
    {
        movement  = FindObjectOfType <MovementClass>(); //References the movement script
        onScreen  = FindObjectOfType <OnScreen>();      // References the onscreen script
        swipe     = FindObjectOfType <Swipe>();
        iceScript = FindObjectOfType <Ice>();


        Player = this.gameObject; // Sets the pkayer variable
    }
예제 #49
0
    public void CastIce()
    {
        Vector3 mousePositioInWorld = Camera.main.ScreenToWorldPoint(Input.mousePosition);

        mousePositioInWorld.z = 0;
        GameObject obj = Instantiate(IceSpell);
        Ice        ice = obj.GetComponent <Ice>();

        ice.SetPosition(mousePositioInWorld);
    }
예제 #50
0
        //-------------------------------------------------------------------------
        // Load, Unload

        public static void Load(System.Action pre, System.Action done)
        {
            Rain.Load(pre, done);
            Thunder.Load(pre, done);
            Ice.Load(pre, done);
            Leaves.Load(pre, done);
            Ghost.Load(pre, done);
            Twinkle.Load(pre, done);
            Spark.Load(pre, done);
        }
예제 #51
0
 public static void Unload()
 {
     Rain.Unload();
     Thunder.Unload();
     Ice.Unload();
     Leaves.Unload();
     Ghost.Unload();
     Twinkle.Unload();
     Spark.Unload();
 }
예제 #52
0
    public static Ice createGameObject(GameObject parent, int r, int c)
    {
        GameObject g = Instantiate(Resources.Load("Ice")) as GameObject;

        g.transform.SetParent(parent.transform);
        Ice ice = g.GetComponent <Ice>();

        ice.init(r, c);
        return(ice);
    }
예제 #53
0
    public void Drift()
    {
        Ice ice = GameObject.Find("IceTrigger").GetComponent <Ice>();

        ice.isOnice = true;

        WheeltoDrift.stiffness = DriftStiffness * Time.deltaTime;


        DriftWheel1.sidewaysFriction = WheeltoDrift;
        DriftWheel2.sidewaysFriction = WheeltoDrift;
    }
예제 #54
0
    void Start()
    {
        dest       = transform.position;
        leftColor  = Color.black;
        rightColor = Color.black;
        leftPower  = true;
        brown      = new Color(0.5f, 0.25f, 0);
        currMix    = "Not a Mix!";

        ice       = this.GetComponent <Ice> ();
        quicksand = this.GetComponent <Quicksand> ();
        lava      = this.GetComponent <Lava> ();
        energy    = this.GetComponent <Energy> ();
    }
예제 #55
0
    public override void OnInspectorGUI()
    {
        Ice ice = this.target as Ice;

        life = ice.life;
        life = EditorGUILayout.IntField("Life:", ice.life);

        if (life != ice.life)
        {
            ice.Init();
            ice.SetLife(life);
        }
        serializedObject.ApplyModifiedProperties();
    }
예제 #56
0
    IEnumerator Attack()
    {
        attack = true;  //whileを動かす

        while (attack)
        {
            //Debug.Log("発射");
            yield return(new WaitForSeconds(waitattackspeed));

            GameObject obj = Instantiate(Ice, new Vector3(transform.position.x, transform.position.y), Quaternion.identity) as GameObject;//Iceプレハブを出す
            //1秒待って
            Ice a = obj.GetComponent <Ice>();
            a.Shoot((MonoBehaviour)this);
        }
    }
예제 #57
0
파일: Slow.cs 프로젝트: BVaflick/gemtd
    public override void Modify(TargetPoint target, float damage)
    {
        WarEntity b = (WarEntity)target.Enemy.Effects.Behaviors.Find(effect => ((WarEntity)effect).name1 == this.GetType().Name + level);

        if (b != null)
        {
            b.age = 0f;
        }
        else
        {
            Ice ice = Game.SpawnIce();
            ice.Initialize(target, this.GetType().Name + level);
            target.Enemy.Effects.Add(ice);
        }
    }
예제 #58
0
        public void multiplyIceWithCost()
        {
            //arrange
            Store  store               = new Store();
            Ice    ice                 = new Ice();
            int    iceToBuy            = 50;
            double iceCost             = ice.GetCost();
            double priceOfpurchacedIce = iceToBuy * iceCost;
            double result;

            //act
            result = store.NumberOfIceCubesPurchased(iceToBuy);
            //assert
            Assert.AreEqual(result, priceOfpurchacedIce);
        }
    public void SendCandidate(string connectionId, RTCIceCandidate candidate)
    {
        Debug.Log("Signaling: SendCandidate");

        CandidateMessage candidateMessage = new CandidateMessage();

        Ice ice = new Ice();

        ice.candidate     = candidate.candidate;
        ice.sdpMid        = candidate.sdpMid;
        ice.sdpMLineIndex = candidate.sdpMLineIndex;

        candidateMessage.ice = ice;
        this.WSSend(JsonUtility.ToJson(candidateMessage));
    }
예제 #60
0
    private void consumeCrown(WordTile tile)
    {
        if (tile.crown)
        {
            List <Anchor> anchors      = getAnchors();
            List <Ice>    ice          = getIce();
            Ice           iceAboveTile = (Ice)getIceTile(tile.getRow(), tile.getCol());

            if (ice.Count > 0 && iceAboveTile != null)
            {
                ice.Remove(iceAboveTile);
            }

            if (anchors.Count > 0) // pop Tile below anchor
            {
                Anchor pickedAnchor = (anchors[UnityEngine.Random.Range(0, anchors.Count)]);
                for (int n = 0; n < pickedAnchor.getRow(); n++)
                {
                    Tile t = getTile(n, pickedAnchor.getCol());
                    if (t is WordTile && t != tile)
                    {
                        popCrown(tile, t);
                        break;
                    }
                }
            }
            else if (ice.Count > 0) //pop tile with ice
            {
                int      random      = UnityEngine.Random.Range(0, ice.Count);
                Ice      pickedIce   = (ice[random]);
                WordTile abovePicked = (WordTile)getTile(pickedIce.getRow(), pickedIce.getCol());
                popCrown(tile, abovePicked);
            }
            else //pop random tile
            {
                List <WordTile> wordTilesList = getWordTiles();
                for (int a = 0; a < wordTilesList.Count; a++)
                {
                    Tile t = wordTilesList[UnityEngine.Random.Range(0, wordTilesList.Count())];
                    if (t is WordTile && t != tile)
                    {
                        popCrown(tile, t);
                        break;
                    }
                }
            }
        }
    }