Пример #1
0
func roomImageMainVerifier(mSet, sSet []string, mLine, sLine int, roomName, filepath string, cherryRooms *config.CherryRooms) *CherryFileError {
	if cherryRooms.HasImage(roomName, mSet[0]) {
		return NewCherryFileError(filepath, mLine, "room image \""+mSet[0]+"\" redeclared.")
	}
	if len(mSet[1]) == 0 {
		return NewCherryFileError(filepath, mLine, "unlabeled room image.")
	}
	if mSet[1][0] != '"' || mSet[1][len(mSet[1])-1] != '"' {
		return NewCherryFileError(filepath, mLine, "room image must be set with a valid string.")
	}
	return nil
}