示例#1
0
    public void RegisterInfo(TestModel model)
    {
        DataWrap wrap = new DataWrap();

        wrap.model = model;
        currentOb  = wrap;
    }
    public void MovePlayer(TestModel model)
    {
        DataWrap wrapper = RetrievePlayer(model);

        if (wrapper == null)
        {
            return;
        }
    }
    public void SpawnPlayer(TestModel md)
    {
        naturalOb.SetActive(false);
        GameObject obj = Instantiate(player, Vector3.zero, Quaternion.identity);

        curPlayer = new DataWrap {
            gameObj = obj, model = md
        };
        this.id = curPlayer.model.Id;
    }
    // sync movement of specific online player
    private void SyncOnlinePlayers(TestModel model)
    {
        DataWrap wrp = spawnManager.RetrievePlayer(model);

        if (wrp == null)
        {
            return;
        }
        wrp.model.Location   = model.Location;
        wrp.model.Rotation   = model.Rotation;
        wrp.model.IsShooting = model.IsShooting;
        wrp.SyncGameObject();
    }
示例#5
0
    public void Spawn(TestModel model)
    {
        DataWrap wrap = new DataWrap();
        Vector3  v3   = new Vector3(model.Location.Location.X, model.Location.Location.Y, model.Location.Location.Z);

        GameObject obj = Instantiate(OB_Prototype, v3, Quaternion.identity);

        wrap.model   = model;
        wrap.gameObj = obj;
        currentOb    = wrap;
        spawned      = true;
        Debug.Log("Spawned!");
        currentOb.SyncModel();
    }
示例#6
0
 /// <summary>
 /// Loads the Settings.json file that contains the settings and populates the DataTypes variable
 /// </summary>
 public static void LoadDataTypes()
 {
     try
     {
         string data = File.ReadAllText(Path.Combine(Application.dataPath + "/", "Settings.json"));
         DataTypes = JsonUtility.FromJson <DataWrap>(data);
     }
     catch (Exception e)
     {
         Debug.Log("Unable to load datatypes " + e);
         Debug.Log("Initializing empty wrapper");
         DataTypes = new DataWrap();
         DataTypes.DataTypesList = new List <DataType>();
     }
 }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
            //var loginWindowView = FindViewById<RelativeLayout>(Resource.Id.loginWindow);

            EditText loginEditTextWindow    = FindViewById <EditText>(Resource.Id.editText_user);
            EditText passwordEditTextWindow = FindViewById <EditText>(Resource.Id.editText_password);
            Switch   switchButton           = FindViewById <Switch>(Resource.Id.change_localization);
            Button   signInButton           = FindViewById <Button>(Resource.Id.button_signIn);
            Button   registrationButton     = FindViewById <Button>(Resource.Id.button_registration);
            TextView mainLabel        = FindViewById <TextView>(Resource.Id.textView_main);
            TextView loginLabel       = FindViewById <TextView>(Resource.Id.textView_username);
            TextView passwordLabel    = FindViewById <TextView>(Resource.Id.textView_password);
            TextView textViewExeption = FindViewById <TextView>(Resource.Id.textViewException);


            IDataWrap       dataWrap       = new DataWrap();
            IRouter         router         = new AndroidRouter(this);
            IAuth_Presenter auth_Presenter = new Auth_Presenter(router, this);

            auth_Presenter.Router = router;

            IAuth_Interactor auth_Intarector = new Auth_Interactor(dataWrap);

            auth_Intarector.Auth_Presenter = auth_Presenter;


            switchButton.Click += ((o, e) =>
            {
                var click = (Switch)o;
                ChangeLocalizationClick?.Invoke(click.Checked);
            });

            registrationButton.Click += ((o, e) =>
            {
                OnRegistrationClick?.Invoke();
            });

            signInButton.Click += ((o, e) =>
            {
                string login = loginEditTextWindow.Text;
                string password = passwordEditTextWindow.Text;
                OnSignInClick?.Invoke(login, password);
            });
        }
示例#8
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            IDataWrap       dataWrap       = new DataWrap();
            IRouter         router         = new IOSRouter(NavigationController);
            IAuth_Presenter auth_Presenter = new Auth_Presenter(router, this);

            auth_Presenter.Router = router;

            IAuth_Interactor auth_Intarector = new Auth_Interactor(dataWrap);

            auth_Intarector.Auth_Presenter = auth_Presenter;

            signInButton.TouchUpInside             += SignInButton_TouchUpInside;
            registrationButton.TouchUpInside       += RegistrationButton_TouchUpInside;
            localizationChangeButton.TouchUpInside += LocalizationChangeButton_TouchUpInside;
        }
 //out end postion
 public abstract int userUnpack(ArrayList pSerializePackList, int pPos, DataWrap pOut);
 //返回第一个数据 一般用以 Hashtable ,Array
 public object unpackToData(string pStr)
 {
     ArrayList lUnpackList = unpackToList(pStr);
     int i = 0;
     DataWrap lOut = new DataWrap();
     //while(i<lUnpackList.Count)
     //{
     //	i=unpack(lUnpackList,i,lOut);
     //}
     unpack(lUnpackList, i, lOut);
     return lOut.data;
 }
 //pSerializePackList  SerializePackData[]  ,
 public int unpack(ArrayList pSerializePackList, int pPos, DataWrap pOut)
 {
     SerializePackData lSerializePackData = pSerializePackList[pPos] as SerializePackData;
     if (lSerializePackData.type == SerializePackType.userdata)
     {
         return getrUserSerializeFromTypeName(lSerializePackData.data)
             .userUnpack(pSerializePackList, pPos + 1, pOut);
     }
     else
     {
         pOut.data = unpack(lSerializePackData);
         return pPos + 1;
     }
 }
 /// <summary>
 /// completely delete the player
 /// </summary>
 public void DeleteCurPlayer()
 {
     Die();
     curPlayer = null;
 }