added side fromString
This commit is contained in:
		
							parent
							
								
									f6c0feda4b
								
							
						
					
					
						commit
						95a9ab63d0
					
				@ -7,4 +7,24 @@ enum abstract Side(String) to String {
 | 
			
		||||
	var Right = "right";
 | 
			
		||||
	var Front = "front";
 | 
			
		||||
	var Back = "back";
 | 
			
		||||
 | 
			
		||||
	@:from
 | 
			
		||||
	static public function fromString(s: String) {
 | 
			
		||||
		switch (s) {
 | 
			
		||||
			case "top":
 | 
			
		||||
				return Top;
 | 
			
		||||
			case "bottom":
 | 
			
		||||
				return Bottom;
 | 
			
		||||
			case "left":
 | 
			
		||||
				return Left;
 | 
			
		||||
			case "right":
 | 
			
		||||
				return Right;
 | 
			
		||||
			case "front":
 | 
			
		||||
				return Front;
 | 
			
		||||
			case "back":
 | 
			
		||||
				return Back;
 | 
			
		||||
			default:
 | 
			
		||||
				return null;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user