private void TapSelectObject(GameObject go)
    {
        if (go == null)
        {
            cbc.HideContextButton();
            return;
        }
        Debug.Log("TapSelectObject " + go.name);
        if (go.animation != null)
        {
            Debug.Log("SelectModel anim play");
            go.animation.Play();
        }
        Light lightComp = go.GetComponentInChildren <Light>();

        if (lightComp != null)
        {
            lightComp.enabled = !lightComp.enabled;
        }
        //if (go.name.StartsWith(PREFIX_PRODUCT)) {
        cbc.ShowContextButton(ContextButtonController.FLAG_PRODUCT);
        //int productId = int.Parse(go.name.Substring(PREFIX_PRODUCT.Length));
        //Product product = LogicController.GetProduct(productId);
        Product product = LogicController.GetProduct(100001);

        if (product != null)
        {
            pvc.product = product;
        }
        //}
    }
 public BooksPage()
 {
     InitializeComponent();
     User = LogicController.CurrentUser();
     mainGrid.DataContext = User.User_Courses;
     userName.DataContext = User;
 }
    private void OnFinishShow()
    {
        if (sceneId == 0)
        {
            Debug.Log("SceneViewController sceneId not initlized");
            return;
        }
        scene = LogicController.GetScene(sceneId);
        if (scene != null)
        {
            title.GetComponent <UILabel>().text = scene.name;

            /*Asset asset = LogicController.GetAsset(scene.assetId);
             * if (asset != null) {
             *  LoadScene(asset);
             * }
             * else {
             *  GetAssetCommand cmd = new GetAssetCommand();
             *  cmd.AssetId = scene.assetId;
             *  cmd.Callback = GetAssetCallback;
             *  cmd.execute();
             * }*/
            //oper = Application.LoadLevelAdditiveAsync("" + scene.sceneId);
            oper = Application.LoadLevelAdditiveAsync("Apartment Scene");
        }
    }
    // Update is called once per frame
    void Update()
    {
        if (lineInput1.GetComponent <Renderer>().material.color == Color.green)
        {
            input1 = true;
        }
        else
        {
            input1 = false;
        }

        if (lineInput2.GetComponent <Renderer>().material.color == Color.green)
        {
            input2 = true;
        }
        else
        {
            input2 = false;
        }

        if (LogicController.Conjunction(input1, input2))
        {
            lineOutput.GetComponent <Renderer>().material.color = Color.green;
        }
        else
        {
            lineOutput.GetComponent <Renderer>().material.color = Color.red;
        }
    }
 // Update is called once per frame
 void Update()
 {
     input1 = lineInput1.GetComponent <Renderer>().material.color == Color.green ? true : false;
     input2 = lineInput2.GetComponent <Renderer>().material.color == Color.green ? true : false;
     lineOutput.GetComponent <Renderer>().material.color =
         LogicController.Implication(input1, input2) ? Color.green : Color.red;
 }
Example #6
0
    private void handle(string str)
    {
        if (string.IsNullOrEmpty(str))
        {
            if (callback != null)
            {
                callback(false);
            }
            return;
        }
        List <SceneType> updateList;
        List <SceneType> deleteList;

        SceneTypeSerializer.ToObjects(str, out updateList, out deleteList);
        if (updateList != null && updateList.Count != 0)
        {
            LogicController.ReplaceSceneTypes(updateList);
        }
        if (deleteList != null && deleteList.Count != 0)
        {
            LogicController.DeleteSceneTypes(deleteList);
        }
        if (callback != null)
        {
            callback(true);
        }
    }
Example #7
0
 private void ClickFavourite(GameObject go)
 {
     Debug.Log("ClickFavourite");
     scene.favourite = !scene.favourite;
     LogicController.UpdateScene(scene);
     ShowFavouriteState();
 }
Example #8
0
    /*
     * public LogicController Instance() {
     *  if (_instance == null) _instance = this;
     *  return _instance;
     * }*/

    private void Awake()
    {
        instance = instance ? instance : this;
        DontDestroyOnLoad(instance);
        lobbyPanel.gameObject.SetActive(true);
        mainGamePanel.gameObject.SetActive(false);
    }
    private void handle(string str)
    {
        if (string.IsNullOrEmpty(str))
        {
            if (callback != null)
            {
                callback(false);
            }
            return;
        }
        List <Scene> updateList;
        List <Scene> deleteList;

        SceneSerializer.ToObjects(str, out updateList, out deleteList);
        bool result = false;

        if (updateList != null && updateList.Count != 0)
        {
            LogicController.ReplaceScenesIgnoreFavourite(updateList);
            result = true;
        }
        if (deleteList != null && deleteList.Count != 0)
        {
            LogicController.DeleteScenes(deleteList);
            result = true;
        }
        if (callback != null)
        {
            callback(result);
        }
    }
Example #10
0
    private void handle(string res)
    {
        if (string.IsNullOrEmpty(res))
        {
            if (callback != null)
            {
                callback(false);
            }
            return;
        }
        List <Recommend> updateList;
        List <Recommend> deleteList;

        RecommendSerializer.ToObjects(res, out updateList, out deleteList);
        if (updateList != null && updateList.Count != 0)
        {
            LogicController.ReplaceRecommends(updateList);
        }
        if (deleteList != null && deleteList.Count != 0)
        {
            LogicController.DeleteRecommends(deleteList);
        }
        if (callback != null)
        {
            callback(true);
        }
    }
Example #11
0
    string BuildMetaData(string fileName, List <string> scenes)
    {
        System.Text.StringBuilder sb = new System.Text.StringBuilder();
        JsonWriter jw = new JsonWriter(sb);

        jw.WriteObjectStart();
        jw.WritePropertyName(Param.ASSET_NAME);
        jw.Write(fileName);
        jw.WritePropertyName(Param.SCENES);
        jw.WriteArrayStart();
        foreach (string path in scenes)
        {
            int   sceneId = int.Parse(StringUtil.GetFileNameWithoutExt(path));
            Scene scene   = LogicController.GetScene(sceneId);
            jw.WriteObjectStart();
            jw.WritePropertyName(Param.SCENE_ID);
            jw.Write(sceneId);
            jw.WritePropertyName(Param.PRODUCTS);
            jw.Write(scene.products);
            jw.WriteObjectEnd();
        }
        jw.WriteArrayEnd();
        jw.WriteObjectEnd();
        return(sb.ToString());
    }
        private void Page_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            Insertdata newday = new Insertdata();

            newday.Subject = LogicController.CurrentUser().courses[0].name;
            newday.Id      = LogicController.CurrentUser().courses[0].time;

            Insertdata newday2 = new Insertdata();

            newday2.Subject = LogicController.CurrentUser().courses[1].name;
            newday2.Id      = LogicController.CurrentUser().courses[1].time;

            Insertdata newday3 = new Insertdata();

            newday3.Subject = LogicController.CurrentUser().courses[2].name;
            newday3.Id      = LogicController.CurrentUser().courses[2].time;

            Insertdata newday4 = new Insertdata();

            newday4.Subject = LogicController.CurrentUser().courses[3].name;
            newday4.Id      = LogicController.CurrentUser().courses[3].time;

            Insertdata newday5 = new Insertdata();

            newday5.Subject = LogicController.CurrentUser().courses[4].name;
            newday5.Id      = LogicController.CurrentUser().courses[4].time;

            numbers.Add(newday);
            numbers.Add(newday2);
            numbers.Add(newday3);
            numbers.Add(newday4);
            numbers.Add(newday5);
            Calculate(numbers);
        }
        public StandingsViewModel()
        {
            this.logicController = new LogicController();

            this.CanSearchConstructors = false;

            this.Cmd = new AsyncRelayCommand(() => this.PopulateResults(this.UserSelectedYear, this.CanSearchConstructors));
        }
Example #14
0
        public void initialisation()
        {
            LogicMaster_test = new LogicController();

            LogicMaster_test.UpdateDisplay    += new LogicController.UpdateDisplayedText(UpdateDisplay_test);
            LogicMaster_test.ErrorOccurred    += new LogicController.DisplayErrorInfo(DisplayMessageBox_test);
            LogicMaster_test.ChangeWordButton += new LogicController.ChangeWordButtonState(ChangeWordButtonState_test);
        }
Example #15
0
    private void handle(string str)
    {
        List <Category> list = CategorySerializer.ToObjects(str);

        if (list != null && list.Count != 0)
        {
            LogicController.ReplaceCategorys(list);
        }
    }
Example #16
0
 public Form1()
 {
     logicController = new LogicController();
     logicGame       = new LogicGame();
     InitializeComponent();
     if (!this.IsHandleCreated)
     {
         this.CreateHandle();
     }
 }
        public ProductListViewModel()
        {
            this.controller = LogicController.Instance;

            _productList = new ObservableCollection <ProductViewModel>();
            _view        = (ListCollectionView)CollectionViewSource.GetDefaultView(_productList);
            InitViewModels();

            _createProductCommand = new RelayCommand(param => this.CreateNewProduct(), param => this.CanCreateProduct());
            _removeProductCommand = new RelayCommand(param => this.DeleteProduct(), param => this.CanRemoveProduct());
            _saveProductCommand   = new RelayCommand(param => this.SaveProduct(), param => this.CanSaveProduct());
        }
Example #18
0
        // Selenium
        private void LoadCourses(User user)
        {
            int i = 0;

            SeleniumLogin.SeleniumLoginInside("s" + LogicController.CurrentUser().id, LogicController.CurrentUser().password);
            foreach (string course in SeleniumLogin.courses)
            {
                Console.WriteLine(course);

                user.courses[i]      = new User.Courses();
                user.courses[i].name = course;
                i++;
            }
        }
Example #19
0
        private void LoginButton_Click(object sender, RoutedEventArgs e)
        {
            string username = StudentNumber.Text;
            string password = StudentPassword.Password;
            int    id       = Int32.Parse(username.Remove(0, 1));
            User   user     = DataController.LoadUserData(id);

            LogicController.SetCurrentUser(user);

            // Sætter password i CurrentUser så det kun eksistere i dén instance.
            LogicController.CurrentUser().password = password;

            Properties.Settings.Default.IsUserLoggedIn = true;
        }
    private void GenerateView()
    {
        picIdList.Clear();
        assetIdList.Clear();
        //List<Recommend> recommends = LogicController.GetRecommends();
        List <Recommend> recommends = GetTestData();

        for (int i = 0; i < recommends.Count; ++i)
        {
            RecommendItemView itemView = RecommendItemView.Create(table);
            itemView.RecommendId = recommends[i].recommendId;
            itemView.PictureId   = recommends[i].pictureId;
            PositionSerialize(recommends[i].position, out itemView.x, out itemView.y, out itemView.width, out itemView.height);
            UIEventListener.Get(itemView.gameObject).onClick = ItemClick;
            itemViewList.Add(itemView);

            Picture picture = LogicController.GetPicture(recommends[i].pictureId);
            if (picture == null)
            {
                picIdList.Add(recommends[i].pictureId);
            }
            else
            {
                Asset asset = LogicController.GetAsset(picture.assetId);
                if (asset == null)
                {
                    assetIdList.Add(picture.assetId);
                }
            }
        }
        tableComp.Reposition();
        if (picIdList.Count != 0)
        {
            GetPictureCommand cmd = new GetPictureCommand();
            cmd.Callback   = AfterGetPicture;
            cmd.PictureIds = picIdList;
            cmd.execute();
        }
        if (assetIdList.Count != 0)
        {
            GetAssetCommand cmd = new GetAssetCommand();
            cmd.Callback = AfterGetAsset;
            cmd.AssetIds = assetIdList;
            cmd.execute();
        }
        picIdList.Clear();
        assetIdList.Clear();
    }
Example #21
0
        /// <summary>
        /// restore project state from temp folder
        /// </summary>
        public async Task RestoreState()
        {
            var storage = rMind.Storage.rMindStorage.GetInstance();
            var doc     = await storage.LoadTmpData();

            var root = doc?.Root;

            if (root != null)
            {
                DeviceController.LoadFromXML(root.Elements("device").FirstOrDefault());
                LogicController.LoadFromXML(root.Elements("logic").FirstOrDefault());
            }

            DeviceController.Draw();
            LogicController.Draw();
        }
Example #22
0
        // Når brugeren logger ind gemmes login skærmen
        private void WhenUserLogsInEvent(object sender, PropertyChangedEventArgs e)
        {
            if (Properties.Settings.Default.IsUserLoggedIn)
            {
                loginFrame.Visibility = Visibility.Hidden;
            }
            else
            {
                loginFrame.Visibility = Visibility.Visible;
            }

            UserId.Text = "s" + LogicController.CurrentUser().id.ToString();
            if (LogicController.CurrentUser().id != 123456)
            {
                LoadCourses(LogicController.CurrentUser());
            }
        }
Example #23
0
        public void Initialize(LogicController logicController, Space space)
        {
            var defaultParticleData = new GravityParticleData(35, 5, Color.Blue);
            var otherParticleData   = new GravityParticleData(35, 10, Color.Blue);
            //var specialParticle = logicController.ParticleController.CreateParticle(otherParticleData, new Vector2(45, 0));
            //specialParticle.Velocity = new Vector2(15, 0);

            var particles = new List <Particle>()
            {
                //    specialParticle,
                logicController.ParticleController.CreateParticle(defaultParticleData, new Vector2(-35, 0)),
                logicController.ParticleController.CreateParticle(defaultParticleData, new Vector2(0, 35)),
                logicController.ParticleController.CreateParticle(defaultParticleData, new Vector2(0, -35))
            };

            space.Particles.AddRange(particles);
        }
Example #24
0
    private void GenerateView()
    {
        Debug.Log("GenerateView");
        ClearView();
        picIdList.Clear();
        assetIdList.Clear();
        List <SceneType> sceneTypes = LogicController.GetSceneTypes();

        for (int i = 0; i < sceneTypes.Count; ++i)
        {
            SceneTypeItemView itemView = SceneTypeItemView.Create(table, sceneTypes[i]);
            UIEventListener.Get(itemView.gameObject).onClick = ItemClick;
            itemViewList.Add(itemView);

            /*Picture picture = LogicController.GetPicture(sceneTypes[i].pictureId);
             * if (picture == null) {
             *  picIdList.Add(sceneTypes[i].pictureId);
             * }
             * else {
             *  Asset asset = LogicController.GetAsset(picture.assetId);
             *  if (asset == null) {
             *      assetIdList.Add(picture.assetId);
             *  }
             * }*/
        }
        tableComp.Reposition();

        /*
         * if (picIdList.Count != 0) {
         *  GetPictureCommand cmd = new GetPictureCommand();
         *  cmd.Callback = AfterGetPicture;
         *  cmd.PictureIds = picIdList;
         *  cmd.execute();
         * }
         * if (assetIdList.Count != 0) {
         *  GetAssetCommand cmd = new GetAssetCommand();
         *  cmd.Callback = AfterGetAsset;
         *  cmd.AssetIds = assetIdList;
         *  cmd.execute();
         * }
         * picIdList.Clear();
         * assetIdList.Clear();
         */
    }
Example #25
0
    public override void execute()
    {
        if (Application.internetReachability == NetworkReachability.NotReachable)
        {
            if (callback != null)
            {
                callback(false);
            }
            return;
        }
        DateTime?dt    = null;
        Scene    scene = LogicController.GetLatestMofifiedScene();

        if (scene != null)
        {
            dt = scene.modified;
        }
        ApiController.GetAllScenes(AppSetting.getInstance().token, dt, handle);
    }
Example #26
0
        public void Init_test()
        {
            LogicController LogicMaster   = new LogicController();
            Brush           expectedColor = Brushes.Black;

            Assert.AreEqual(expectedColor, LogicMaster.CurrentFontColor);

            LogicController.NumberBaseSystem expecteSystem = LogicController.NumberBaseSystem.Decimal;
            Assert.AreEqual(expecteSystem, LogicMaster.CurrentNumberBaseSystem);

            LogicController.FontSizes expectedSize = LogicController.FontSizes.Big;
            Assert.AreEqual(expectedSize, LogicMaster.CurrentFontSize);

            string expectedEquation = "0";

            Assert.AreEqual(expectedEquation, LogicMaster.CurrentEquationState);

            LogicController.WordLengths expectedLength = LogicController.WordLengths.QWORD;
            Assert.AreEqual(expectedLength, LogicMaster.CurrentWordLength);
        }
Example #27
0
    private void handle(string str)
    {
        if (string.IsNullOrEmpty(str))
        {
            if (callback != null)
            {
                callback(false);
            }
            return;
        }
        List <Picture> list = PictureSerializer.ToObjects(str);

        if (list != null && list.Count != 0)
        {
            LogicController.ReplacePictures(list);
        }
        if (callback != null)
        {
            callback(true);
        }
    }
Example #28
0
    private void handle(string res)
    {
        if (string.IsNullOrEmpty(res))
        {
            if (callback != null)
            {
                callback(null);
            }
            return;
        }
        List <Asset> list = AssetSerializer.ToObjects(res);

        if (list != null && list.Count != 0)
        {
            LogicController.ReplaceAssets(list);
        }
        if (callback != null)
        {
            callback(null);
        }
    }
Example #29
0
    public void ShowPicture()
    {
        if (IsPictureShowed())
        {
            return;
        }
        Debug.Log("ShowPicture call");
        Picture picture = LogicController.GetPicture(pictureId);

        if (picture == null)
        {
            return;
        }
        Asset asset = LogicController.GetAsset(picture.assetId);

        if (asset == null)
        {
            return;
        }
        AssetBundleManager.GetObject(AppSetting.getInstance().assetUrl + asset.name, asset.version,
                                     new string[] { picture.atlasName }, LoadCallback);
    }
Example #30
0
 public void Initialize(LogicController logicController, Space space)
 {
     Console.WriteLine("Go!");
 }
Example #31
0
 void Start()
 {
     _logicConroller = GameObject.FindGameObjectWithTag("Logic Controller").GetComponent<LogicController>();
     shutterPosition = 0;
     frameCount = Time.frameCount;
 }