Esempio n. 1
0
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            ResultsState state      = (ResultsState)value;
            LocalStatus  localState = (LocalStatus)Enum.Parse(typeof(LocalStatus), value.ToString());

            switch (state)
            {
            case (ResultsState.NewPB):
                if (localState == LocalStatus.NewPB)
                {
                    return(new SolidColorBrush(Colors.Honeydew));
                }
                break;

            case (ResultsState.NewSB):
                if (localState == LocalStatus.NewSB)
                {
                    return(new SolidColorBrush(Colors.LightCyan));
                }
                break;

            case (ResultsState.FirstTimer):
                if (localState == LocalStatus.FirstTimer)
                {
                    return(new SolidColorBrush(Colors.LemonChiffon));
                }
                break;
            }
            return(new SolidColorBrush(Colors.Transparent));
        }
Esempio n. 2
0
    void Start()
    {
        m_triggers = (VictoryTrigger[])GameObject.FindObjectsOfType(typeof(VictoryTrigger));
        StartCoroutine(checkForVictory());
        m_resultState = (ResultsState)GameObject.FindObjectOfType(typeof(ResultsState));


        GameObject planeObject = GameObject.Find("Plane");

        if (planeObject)
        {
            int floorIndex = PlayerPrefs.GetInt("TableIndex", 0);

            //if(floorIndex>1)
            {
                if (material)
                {
                    Texture tex = Resources.Load("Wall" + PlayerPrefs.GetInt("TableIndex", 0)) as Texture;
                    material.SetTexture("_MainTex", tex);
                }
            }

            if (floorIndex > 0)
            {
                planeObject.GetComponent <Renderer>().material = Resources.Load("Floor" + PlayerPrefs.GetInt("TableIndex", 0)) as Material;
            }
        }
        Application.targetFrameRate = 60;
    }
        private void SetNextState()
        {
            this.state = this.state != ResultsState.TwelvePoints ? this.state + 1 : ResultsState.RevealCountry;

            if (this.state == ResultsState.SplashScreen)
            {
                Messenger.Default.Send(new ReadyForLateVotesMessage());
            }

            if (this.state == ResultsState.RevealCountry)
            {
                if (Countries.Count(c => c.IsInQueue) > 0)
                {
                    this.currentlyRevealedCountry = GetSelectedCountry();
                }
                else
                {
                    this.state = ResultsState.RevealWinner;
                }
            }

            if (this.state == ResultsState.TwelvePoints)
            {
                if (this.currentlyRevealedCountry != null)
                {
                    this.currentlyRevealedCountry.IsSelected = false;
                    this.currentlyRevealedCountry.IsInQueue  = false;

                    if (Countries.Count(c => c.IsInQueue) > 0)
                    {
                        if (Countries.Count(c => c.IsInQueue && c.IsSelected) == 0)
                        {
                            Countries.First(c => c.IsInQueue).IsSelected = true;
                        }
                    }
                }
            }

            var selectedCountryId = Countries.FirstOrDefault(c => c.IsSelected)?.Id;

            Model.Country nextCountry = null;
            if (selectedCountryId.HasValue)
            {
                nextCountry = dataService.GetCountry(selectedCountryId.Value);
            }

            Messenger.Default.Send(new ChangeStateMessage(this.state, nextCountry));
            NextCommand.RaiseCanExecuteChanged();
        }
 public ChangeStateMessage(ResultsState state, Country currentCountry)
 {
     State          = state;
     CurrentCountry = currentCountry;
 }