Exemplo n.º 1
0
    public void UpdateServerSlot(ServerSlotState a_state, ServerSlotType a_type)
    {
        switch (a_state)
        {
        case ServerSlotState.Insert:
            m_currentActivatedSlots++;
            Insert(a_type);
            if (IsActivated())
            {
                // ALL SLOTS ENABLED
                Debug.Log("Server [" + gameObject.name + "] activated.");
                GetComponent <AudioSource>().Play(); // ENABLE SOUND
            }
            break;

        case ServerSlotState.Remove:
            Remove(a_type);
            if (IsActivated())
            {
                // server is currently activated, but object is pulled off
                // server will be deactivated
                Debug.Log("Server [" + gameObject.name + "] deactivated.");
                GetComponent <AudioSource>().Play(); // DISABLE SOUND
            }
            m_currentActivatedSlots--;
            break;
        }

        // update info screen
        m_notebookScreen.GetComponent <IServerNotebook>().ChangeState(this);
    }
Exemplo n.º 2
0
    public bool IsInserted(ServerSlotType a_type)
    {
        ServerSlotType tmp = m_currentInsertedTypes & a_type;

        // if tmp is the same as a_value the bit is set
        return(tmp == a_type);
    }
Exemplo n.º 3
0
 public void Remove(ServerSlotType a_type)
 {
     m_currentInsertedTypes ^= a_type;
 }
Exemplo n.º 4
0
 public void Insert(ServerSlotType a_type)
 {
     m_currentInsertedTypes |= a_type;
 }