示例#1
0
        public static bool IsVisible(this LockState state, string propertyName)
        {
            switch (propertyName)
            {
            case nameof(LockState.locked):
                return(true);

            case nameof(LockState.mode):
                return(state.locked && !state.Private);

            case nameof(LockState.petDoor):
                return(state.locked);

            case nameof(LockState.pensDoor):
                return(true);

            case nameof(LockState.owners):
                return(state.locked);

            case nameof(LockState.allowAnimals):
                return(state.locked);

            case nameof(LockState.allowSlave):
                return(state.locked);

            default:
                return(true);
            }
        }
示例#2
0
 public void CopyFrom(LockState copy)
 {
     mode    = copy.mode;
     locked  = copy.locked;
     petDoor = copy.petDoor;
     owners.Clear();
     owners.AddRange(copy.owners);
 }
示例#3
0
        public void CopyFrom(LockState copy)
        {
            mode     = copy.mode;
            locked   = copy.locked;
            petDoor  = copy.petDoor;
            pensDoor = copy.pensDoor;
            owners.Clear();
            owners.AddRange(copy.owners);

            allowSlave   = copy.allowSlave;
            allowAnimals = copy.allowAnimals;
        }
示例#4
0
 public LockData()
 {
     CurrentState = new LockState(LockMode.Allies, true, false, new List <Pawn>());
     WantedState  = new LockState(LockMode.Allies, true, false, new List <Pawn>());
 }