Ejemplo n.º 1
0
        /// <summary>
        /// Constructor that sets up the color and pawns for a player and draws each pawn to the screen
        /// </summary>
        /// <param name="color"></param>
        /// <param name="fieldCanvas"></param>
        public Player(PlayerColor color, Canvas fieldCanvas)
        {
            Color = color;
            if (color == PlayerColor.green)
            {
                _start  = FieldArea.GreenHome;
                _finish = FieldArea.GreenFinish;
            }
            if (color == PlayerColor.yellow)
            {
                _start  = FieldArea.YellowHome;
                _finish = FieldArea.YellowFinish;
            }
            if (color == PlayerColor.blue)
            {
                _start  = FieldArea.BlueHome;
                _finish = FieldArea.BlueFinish;
            }
            if (color == PlayerColor.red)
            {
                _start  = FieldArea.RedHome;
                _finish = FieldArea.RedFinish;
            }

            _pawns = new Pawn[4];

            for (int i = 0; i < _pawns.Length; i++)
            {
                _pawns[i] = new Pawn(color, i, fieldCanvas);
            }
        }
        PivotGridField CreatePivotGridField(string fieldName, string caption, FieldArea area)
        {
            PivotGridField field = new PivotGridField(fieldName, area);

            field.Caption = caption;
            return(field);
        }
Ejemplo n.º 3
0
 void ResetField(PivotGridField field, FieldArea area, int areaIndex)
 {
     field.Area      = area;
     field.AreaIndex = areaIndex;
     field.FilterValues.Clear();
     field.FilterValues.FilterType = FieldFilterType.Excluded;
 }
Ejemplo n.º 4
0
        static List <PivotGridField> GetFieldsInArea(PivotGridControl pivot, FieldArea area)
        {
            List <PivotGridField> fields = new List <PivotGridField>();

            for (int i = 0; i < pivot.Fields.Count; i++)
            {
                if (pivot.Fields[i].Area == area)
                {
                    fields.Add(pivot.Fields[i]);
                }
            }
            return(fields);
        }
Ejemplo n.º 5
0
        static FieldAllowedAreas GetAllowedArea(FieldArea area)
        {
            switch (area)
            {
            case FieldArea.ColumnArea:
                return(FieldAllowedAreas.ColumnArea);

            case FieldArea.RowArea:
                return(FieldAllowedAreas.RowArea);

            case FieldArea.DataArea:
                return(FieldAllowedAreas.DataArea);

            case FieldArea.FilterArea:
                return(FieldAllowedAreas.FilterArea);

            default:
                return(FieldAllowedAreas.All);
            }
        }
        private string GetConditionSpecial(FieldArea area)
        {
            string condition = "";

            var fields = GetFieldsByArea(area);
            foreach (var field in fields)
            {
                if (field.FilterValues.ValuesExcluded.Length == 0)
                {
                    continue;
                }
                if (field.FilterValues.ValuesIncluded.Length == 0)
                {
                    condition = " and 1=2 ";
                    continue;
                }
                if (field.FilterValues.ValuesIncluded.Length < field.FilterValues.ValuesExcluded.Length)
                {
                    condition = condition + " and " + field.FieldName + " in (";
                    for (int i = 0; i < field.FilterValues.ValuesIncluded.Length; i++)
                    {
                        string value;
                        if (field.DataType.Name.Equals("String"))
                        {
                            value = "\'" + field.FilterValues.ValuesIncluded[i] + "\'";
                        }
                        else
                        {
                            value = field.FilterValues.ValuesIncluded[i].ToString();
                        }
                        if (i == field.FilterValues.ValuesIncluded.Length - 1)
                        {
                            condition = condition + value + ")";
                        }
                        else
                        {
                            condition = condition + value + ",";
                        }
                    }
                }
                else
                {
                    condition = condition + " and " + field.FieldName + " not in (";
                    for (int i = 0; i < field.FilterValues.ValuesExcluded.Length; i++)
                    {
                        string value;
                        if (field.DataType.Name.Equals("String"))
                        {
                            value = "\'" + field.FilterValues.ValuesExcluded[i] + "\'";
                        }
                        else
                        {
                            value = field.FilterValues.ValuesExcluded[i].ToString();
                        }
                        if (i == field.FilterValues.ValuesExcluded.Length - 1)
                        {
                            condition = condition + value + ")";
                        }
                        else
                        {
                            condition = condition + value + ",";
                        }
                    }
                }
            }
            return condition;
        }
Ejemplo n.º 7
0
 void OnEnable()
 {
     main = this;
     UpdateParameters();
     GameCamera.main.OnScreenResize();
 }
Ejemplo n.º 8
0
        }                                  // TODO: add checks

        public FieldLocation(FieldArea area, int position)
        {
            Area     = area;
            Position = position;
        }
Ejemplo n.º 9
0
    // Update is called once per frame
    void Update()
    {
        if (m_FieldAreas != null)
        {
            bool is_update_field_view = false;

            // 復活可能かどうか更新
            if (m_FieldAreas.m_IsResurrectMode != m_IsResurrectMode)
            {
                m_IsResurrectMode    = m_FieldAreas.m_IsResurrectMode;
                is_update_field_view = false;
            }

            // 定期的更新の確認
            m_BasePanelUpdateCounter--;
            if (m_BasePanelUpdateCounter <= 0)
            {
                is_update_field_view = true;
            }

            // BOOST・FULLが更新されたかを更新
            if (is_update_field_view == false)
            {
                for (int field_idx = 0; field_idx < m_FieldAreas.getFieldAreaCountMax(); field_idx++)
                {
                    FieldArea field_area = m_FieldAreas.getFieldArea(field_idx);
                    if (field_area != null)
                    {
                        if (m_ViewObjects[field_idx].m_Boost.IsActive() != field_area.m_IsBoost ||
                            m_ViewObjects[field_idx].m_Full.IsActive() != field_area.isFull()
                            )
                        {
                            is_update_field_view = true;
                            break;
                        }
                    }
                }
            }

            if (is_update_field_view)
            {
                m_BasePanelUpdateCounter = 30;
            }

            for (int field_idx = 0; field_idx < m_FieldAreas.getFieldAreaCountMax(); field_idx++)
            {
                FieldArea field_area = m_FieldAreas.getFieldArea(field_idx);
                if (field_area != null)
                {
                    // カード表示を更新
                    for (int card_idx = 0; card_idx < field_area.getCardCount(); card_idx++)
                    {
                        BattleScene.BattleCard battle_card = field_area.getCard(card_idx);
                        if (battle_card != null)
                        {
                            if (battle_card.isChangePhase())
                            {
                                battle_card.resetChangePhase();
                                float duration = 0.05f;
                                if (battle_card.m_ViewControl.gameObject.IsActive() == false)
                                {
                                    battle_card.m_ViewControl.gameObject.SetActive(true);
                                    duration = 0.0f;
                                }
                                battle_card.m_ViewControl.setSnapToParent(getBattleCardTransform(field_idx, card_idx), duration);
                            }
                        }
                    }

                    // 下地パネル・BOOST・FULL表示を更新
                    if (is_update_field_view)
                    {
                        if (m_SelectedField != field_idx)
                        {
                            if (m_IsResurrectMode &&
                                field_area.m_IsBoost
                                )
                            {
                                m_ViewObjects[field_idx].m_PanelBase.SetActive(false);
                                m_ViewObjects[field_idx].m_PanelSelect.SetActive(false);
                                m_ViewObjects[field_idx].m_PanelRBase.SetActive(true);
                                m_ViewObjects[field_idx].m_PanelRSelect.SetActive(false);
                            }
                            else
                            {
                                m_ViewObjects[field_idx].m_PanelBase.SetActive(true);
                                m_ViewObjects[field_idx].m_PanelSelect.SetActive(false);
                                m_ViewObjects[field_idx].m_PanelRBase.SetActive(false);
                                m_ViewObjects[field_idx].m_PanelRSelect.SetActive(false);
                            }
                        }
                        else
                        {
                            if (m_IsResurrectMode &&
                                field_area.m_IsBoost
                                )
                            {
                                m_ViewObjects[field_idx].m_PanelBase.SetActive(false);
                                m_ViewObjects[field_idx].m_PanelSelect.SetActive(false);
                                m_ViewObjects[field_idx].m_PanelRBase.SetActive(false);
                                m_ViewObjects[field_idx].m_PanelRSelect.SetActive(true);
                            }
                            else
                            {
                                m_ViewObjects[field_idx].m_PanelBase.SetActive(false);
                                m_ViewObjects[field_idx].m_PanelSelect.SetActive(true);
                                m_ViewObjects[field_idx].m_PanelRBase.SetActive(false);
                                m_ViewObjects[field_idx].m_PanelRSelect.SetActive(false);
                            }
                        }

                        m_ViewObjects[field_idx].m_Boost.SetActive(field_area.m_IsBoost);
                        m_ViewObjects[field_idx].m_Full.SetActive(field_area.isFull());
                    }
                }
            }
        }
    }
        private void CopyArea(PivotGridControl control, FieldArea area)
        {
            foreach (var field in control.GetFieldsByArea(area))
            {
                PivotGridField f = field.FieldName.Equals("MEASURE_STATUS") ? Fields["MEASURE_STATUS_NEW"] : Fields[field.FieldName];
                f.Visible = true;
                f.Area = area;

                if (field.FieldName.Contains("LOC"))
                {
                    f.FilterValues.ValuesIncluded = field.GetVisibleValues().ToArray();
                }
                else if (field.FieldName.Contains("MEASURE") == false)
                {
                    if (field.FilterValues.HasFilter)
                    {
                        f.FilterValues.ValuesIncluded = field.FilterValues.ValuesIncluded;
                    }
                }
            }
        }