Ejemplo n.º 1
0
    public void SetState(GridElementState NewState, bool AllTheWay = false)
    {
        if (AllTheWay)
        {
            MyPrevState = NewState;
        }
        else
        {
            MyPrevState = MyCurrState;
        }
        MyCurrState = NewState;
        switch (MyCurrState)
        {
        case GridElementState.Empty:
            MyImage.color = SeaColor;
            break;

        case GridElementState.Occupied:
            MyImage.color = OccupiedColor;
            break;

        case GridElementState.Hit:
            MyImage.color = HitColor;
            break;

        case GridElementState.Invalid:
            MyImage.color = InvalidColor;
            break;

        case GridElementState.Hovering:
            MyImage.color = HoveringColor;
            break;
        }
    }
Ejemplo n.º 2
0
 public GridElementBase()
 {
     m_bValid         = true;
     m_needUpdateDisp = new AddOnceEventDispatch();
     m_elemState      = GridElementState.eNormal;
 }
Ejemplo n.º 3
0
 public GridElementBase()
 {
     m_bValid = true;
     m_needUpdateDisp = new AddOnceEventDispatch();
     m_elemState = GridElementState.eNormal;
 }