Exemple #1
0
    private void LinkWithSurroundingTable(Furniture furnitrue)
    {
        if (LinkedTable)
        {
            LinkedTable.UnlinkChair(this);
            LinkedTable = null;
        }

        var searchInfos = OwnerFloor.SearchSurroundingFurniture <Table>(this);

        if (searchInfos == null)
        {
            return;
        }

        foreach (var searchInfo in searchInfos)
        {
            if (searchInfo.relativeDirection == ReverseDirection &&
                searchInfo.furniture.CurrentState == FurnitureState.Bought)
            {
                LinkedTable = searchInfo.furniture;
                LinkedTable.LinkChair(this);
                break;
            }
        }
    }
Exemple #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Name != null ? Name.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ColumnNames != null ? ColumnNames.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (LinkedNames != null ? LinkedNames.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (LinkedTable != null ? LinkedTable.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (int)OnDelete;
         hashCode = (hashCode * 397) ^ (int)OnUpdate;
         return(hashCode);
     }
 }