示例#1
0
 /* Create tile */
 public Tile(Vector2 dimensions, Vector2 worldPosition, Vector2 gridPosition, int index)
 {
     _dims           = dimensions;
     _pos            = worldPosition;
     _gridPos        = gridPosition;
     _isOccupied     = false;
     _occupier       = null;
     _hasProp        = false;
     _prop           = null;
     _index          = index;
     _isOriginOfProp = false;
 }
示例#2
0
 /* Set the prop on the tile (must be occupied first) */
 public bool SetProp(LevelPropEntity prop, bool destroyPrevious = true, bool destroyPreviousWithAnimation = true)
 {
     if (prop != null && !IsOccupied)
     {
         return(false);
     }
     if (_prop && destroyPrevious)
     {
         _prop.DestroyMe(destroyPreviousWithAnimation);
     }
     _hasProp        = (prop != null);
     _prop           = prop;
     _isOriginOfProp = false;
     return(true);
 }
示例#3
0
    private void RotateDoor(LevelPropEntity entity)
    {
        switch (entity.Rotation)
        {
        case PropRotation.FACING_FRONT:
            entity.SetRotation(PropRotation.FACING_LEFT);
            break;

        case PropRotation.FACING_LEFT:
            entity.SetRotation(PropRotation.FACING_FRONT);
            break;

        case PropRotation.FACING_BACK:
            entity.SetRotation(PropRotation.FACING_RIGHT);
            break;

        case PropRotation.FACING_RIGHT:
            entity.SetRotation(PropRotation.FACING_BACK);
            break;
        }
    }