コード例 #1
0
        public void ServiceAndServiceStubsBelongToTheSameNamespace()
        {
            var mgr = new GlobalObjectManager();

            Assert.That(() => mgr.RegisterService(new RpcServiceStub(), "Service1"), Throws.Nothing);
            Assert.That(() => mgr.RegisterService(new RpcService("Service1")), Throws.TypeOf <ArgumentException>());
        }
コード例 #2
0
        public void RefuseToRegisterServiceStubWithDuplicateName()
        {
            var mgr = new GlobalObjectManager();

            Assert.That(() => mgr.RegisterService(new RpcServiceStub(), "Service1"), Throws.Nothing);
            Assert.That(() => mgr.RegisterService(new RpcServiceStub(), "Service1"), Throws.TypeOf <ArgumentException>());
        }
コード例 #3
0
 public void Awake()
 {
     if (sharedObject == null)
     {
         sharedObject = this;
         DontDestroyOnLoad(gameObject);
     }
 }
コード例 #4
0
 // Use this for initialization
 void Start()
 {
     if (instance == null)
     {
         instance = this;
         InitializeObjects();
         SceneManager.sceneLoaded += SceneLoaded;
         SceneLoaded(gameObject.scene, LoadSceneMode.Single);
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(gameObject);
 }
コード例 #5
0
        public void RegisterDistinctServices()
        {
            var service1 = new RpcService("Service1");
            var service2 = new RpcService("Service2");
            var service3 = new RpcServiceStub();

            var mgr = new GlobalObjectManager();

            mgr.RegisterService(service1);
            mgr.RegisterService(service2);
            mgr.RegisterService(service3, "Service3");

            Assert.That(mgr.GetService("Service1"), Is.SameAs(service1));
            Assert.That(mgr.GetService("Service2"), Is.SameAs(service2));
            Assert.That(mgr.GetService("Service3"), Is.SameAs(service3));
        }
コード例 #6
0
    // ゲーム開始の準備
    private IEnumerator GameReady()
    {
        if (GlobalObjectManager.GetSharedObject() != null)
        {
            m_PlayerNum = GlobalObjectManager.GetSharedObject().GetGamePlayerNum();
            m_MaxHP     = GlobalObjectManager.GetSharedObject().GetPlayerHP();
        }
        m_PlayerBoard.GetComponent <PlayerBoardManager>().SetPlayerBoard(m_PlayerNum);
        for (int i = 0; i < m_PlayerNum; i++)
        {
            m_PlayerHP.Add(m_MaxHP);
        }
        SetPullButton(false);
        SetAnnouncePanel(false);
        GameInfo();
        yield return(StartCoroutine(SetDeckCount()));

        yield return(StartCoroutine(SetFirstCard()));

        StartCoroutine(GameLoop());
    }
コード例 #7
0
 void Awake()
 {
     Instance = this;
 }
コード例 #8
0
        public void RefuseToRegisterServiceStubWithAllNullParameters()
        {
            var mgr = new GlobalObjectManager();

            Assert.That(() => mgr.RegisterService(null, null), Throws.ArgumentNullException);
        }
コード例 #9
0
        public void RefuseToRegisterNullServiceStub()
        {
            var mgr = new GlobalObjectManager();

            Assert.That(() => mgr.RegisterService(null, "Service1"), Throws.ArgumentNullException);
        }
コード例 #10
0
        public void RefuseToRegisterServiceWithNullName()
        {
            var mgr = new GlobalObjectManager();

            Assert.That(() => mgr.RegisterService(new RpcService(null)), Throws.ArgumentNullException);
        }
コード例 #11
0
        public void UnknownServiceRequestShouldReturnNull()
        {
            var mgr = new GlobalObjectManager();

            Assert.That(mgr.GetService("Service1"), Is.Null);
        }
コード例 #12
0
 // プレイヤー人数の選択
 public void GameStart(int num)
 {
     GlobalObjectManager.LoadLevelWithSharedObject("MainGame", num);
 }
コード例 #13
0
 internal static IFSGlobalObjects GenerateGlobal(NVIdentity identity)
 {
     return(((IFSGlobalObjects)GlobalObjectManager.CreateGlobalObject(guid.NewGuid().Value))
            .Authenticate(identity)
            .EnableCaching());
 }
コード例 #14
0
 private void OnEnable()
 {
     //Do not use with Awake (they do the same sort of)
     Instance = this;
 }