*82OPINION
By the Court,
Springer, J.:This is an appeal from a summary judgment in favor of the respondents in a negligence action. The claimed negligence arouse out of an incident in which the injured plaintiff, appellant Ann Ashwood, injured her knee as she attempted to come to the assistance of a fallen horseback rider at Horseman’s Park in Las Vegas. Ashwood was in the barn area of the park at the time she learned of the accident. Ashwood at first tried to reach the fallen rider by leaving the barn area through a nearby gate, but found that the gate was locked. There was another gate nearby, less than 150 feet from the locked gate; nevertheless, Ashwood sued Clark County and others claiming that they had a duty to keep the locked gate open and that breach of that duty was the cause of her injuries.
Because we are asked to rule on the correctness of the trial court’s ruling that no duty was owed by any of the respondents to keep the gate unlocked, it will be necessary for us to relate the facts relating to Ashwood’s claims in some detail. Because this case is before this court upon appeal of an award of summary judgment, the facts are related in the light most favorable to appellant. See Butler v. Bogdanovich, 101 Nev. 449, 451, 705 P.2d 662, 663 (1985).
On September 1, 1990, Ashwood and her family attended a horseshow at Horseman’s Park in Las Vegas. The park is owned by defendant/respondent Clark County. On the date in question, the park was leased to defendant/respondent Nevada State Horseman’s Association (NSHA), the sponsor of the event.
The park includes a barn area surrounded by a chain-link fence. There are several gateways through the fence, although on the night in question only the main gateway to the south remained unlocked. Ashwood was assigned a stall in Barn “C” near the western fence line. While in the barn area, she heard the sounds of a runaway horse and cries for help. She observed a rider lying on the ground in an open area to the west of the barn area and on the other side of the fence.
Ashwood, who is trained in CPR, believed that the fallen rider needed immediate assistance and ran toward the nearest gate in *83the barn area fence to assist the injured rider. The nearest gate was the west gate, which was locked. Concerned that the fallen rider might be unconscious and not breathing, Ashwood attempted to climb over the chain-link fence, rather than run through the open main gate approximately 150 feet away. Unfortunately, Ashwood fell in the process and sustained a severe injury to her knee.
Ashwood brought suit against Clark County, the NSHA, and the manager of the barn area, Dixie Bennett (referred to collectively as “Respondents”). Ashwood claims that Respondents are liable in negligence for failing to keep the west gate unlocked. After substantial discovery, Respondents moved for summary judgment. Ashwood filed a response to Respondents’ motion and filed a cross-motion for partial summary judgment on the issue of duty.
In support of her motion for summary judgment, Ashwood presented the district court with the affidavit of Dan Cashdan (Cashdan), a registered civil engineer employed by the State of Nevada. Cashdan is thoroughly familiar with the Uniform Building Code (“U.B.C.”) in effect in Clark County at the time of the incident, and his duties include reviewing building plans for compliance with the Building Code. Cashdan testified that the Building Code required the west gate be operable from inside the barn area. According to Cashdan, the padlocked west gate was a “clear violation” of the Building Code and a danger to public safety.
Ashwood also supported her motion with the affidavit of Drusilla E. Malavase (Malavase), an expert in equestrian training and safety for the past forty years and an organizer of horse-shows. Malavase testified that Respondents’ conduct was below the national standard of care, which “mandates that gates shall not be locked during the show and while the public is present.” According to Malavase:
It is a known risk of and a common occurrence at horse-shows for horses to behave erratically and endanger people in the area. This is especially true in a barn area where many horses congregate. It is highly foreseeable that an emergency will occur requiring people to exit the barn area quickly. In addition, to avoid the hazard of panic which can occur in these emergency situations, it is essential that exits in the barn area remain open and usable. By having the gate locked every person in the barn area was placed at risk and in danger. In so doing, the NSHA clearly fell below the standard of care of a reasonable person or group conducting a horseshow like the Labor Day Show.
*84Ashwood also presented the district court with the lease agreement between NSHA and Clark County, under which NSHA was obligated to comply with all laws and ordinances of the State of Nevada and Clark County. The lease agreement provided, among other things, that:
[N]o portion of the sidewalks, entries, passages, elevators, ramps, stairways, or access to public utilities of said buildings or grounds shall be obstructed or used for any purpose other than for ingress and egress to and from the premises.
Finally, Ashwood presented evidence that, at past horseshows, people had climbed over fences to rescue fallen riders.
On January 20, 1994, the district court granted Respondents’ motion for summary judgment and denied Ashwood’s cross-motion for partial summary judgment. On February 2, 1994, the district court entered judgment in favor of Respondents. Ashwood appealed.
Ashwood contends that the district court erred in granting summary judgment because there are material facts remaining to be tried and that, therefore, Respondents were not entitled to judgment as a matter of law.
The first question raised by appellant Ashwood is whether, as a matter of law, the trial court erred in ruling that no duty was owed to her to keep the gate in question unlocked. In this regard Ashwood claims that Respondents owed her a common law duty, that Respondents were guilty of negligence per se, and that Respondents owed her a contractual duty to keep the west gate unlocked. We consider each of these claims in turn.
Common Law Duty
It is the courts and not juries that have the ultimate responsibility of defining duty in relation to particular circumstances and to define the legal standard of reasonable conduct “ ‘in the light of the apparent risk.’ ” Merluzzi v. Larson, 96 Nev. 409, 412-13, 610 P.2d 739, 742 (1990) (quoting W. Prosser, Law of Torts, § 53 at 324 (4th ed. 1971) (emphasis added)), overruled in part on other grounds, Smith v. Clough, 106 Nev. 568, 570 n.2, 796 P.2d 594 (1990). By defining the scope of duty in negligence cases that come before them, the courts are making a vital “expression of the aggregate of those policy considerations which cause the law to conclude that protection is owed.” Merluzzi, 96 Nev. at 409, 610 P.2d at 742.
Ashwood presents two arguments on the duty question. First, she argues that there was a specific duty to keep the west gate *85unlocked because it was foreseeable that in an emergency she would need to use the padlocked gate to exit the barn area. Ashwood also argues that the Respondents should have foreseen that during an emergency people would attempt to exit the barn area by climbing the fence if the gate were locked.
Foreseeability of harm is, of course, a predicate to establishing the element of duty. Id. at 414, 610 P.2d at 742; and Respondents contend that a fallen rider in another part of the park is not the kind of foreseeable emergency that would give rise to a duty, enforceable by Ashwood, to keep the west gate unlocked. Respondents emphasize the unquestioned fact that there was an alternate safe means for Ashwood to carry out the intended rescue, namely, by going through the other, unlocked main gate that was less than 150 feet away. Respondents argue that there was no duty to provide the shortest or quickest route to any area of the horseshow grounds.
Ashwood has presented no evidence to suggest that the main gate, located 150 feet away from the locked gate, would have been inadequate to effect the intended rescue. Ashwood did not contend that she was physically incapable of traversing the additional distance nor that going to the open gate would have put her in personal danger or unacceptably delayed her attempted rescue. The exigent circumstances presented by the fallen rider did not constitute the kind of emergency alluded to by Ashwood’s own experts — such as a fire, panic, or stampede — where an alternative means of egress may not have been reasonably available and where the immediacy of the danger combined with the inability to use the locked gate might have necessitated an attempt to scale the fence rather than to proceed to the unlocked gate. Under the circumstances, we agree with Respondents that this case really boils down to whether there existed a duty to provide Ashwood the shortest or quickest route from one area of the park to another. We conclude that there was no such duty. Accord Nicoletti v. Westcor, Inc., 639 P.2d 330, 333 (Ariz. 1982) (“The landowner has a duty to provide a reasonably safe means of ingress and egress for those who enter onto the land. . . . The landowner, however, does not have to provide the shortest route to any destination.”); Harris v. Union Stock Yard & Transit Co. of Chicago, 331 N.E.2d 182, 188 (Ill. App. Ct. 1975) (landowner owes invitee a duty to provide a reasonably safe means of ingress and egress, but not necessarily the shortest route to the invitee’s destination).1
*86In light of the particular risk present in this case, Respondents’ common law duty of reasonable care did not give rise to a specific duty to keep the west gate unlocked.
Negligence per se
Ashwood also contends that a duty to keep the west gate unlocked arose under the Clark County Building Code (the Code).2 In response, Respondents first argue that the sections of the Code cited by Ashwood are not applicable either to the barn area or to the area surrounding the fence. Second, Respondents argue that, even if Respondents did violate the Code, the violations do not amount to negligence per se.
A violation of statute establishes the duty and breach elements of negligence only if the injured party belongs to the class of persons that the statute was intended to protect, and the injury is of the type against which the statute was intended to protect. Sagebrush Ltd. v. Carson City, 99 Nev. 204, 208, 660 P.2d 1013, 1015 (1983).
Ashwood contends that the Code prohibits Respondents from padlocking the west gate while the public is present. Ashwood’s contention depends upon the barn area being a “Group A Occupancy” under U.B.C. section 601 and the west gate being a required “exit.” Exit doors in a Group A Occupancy are not to be latched or locked except with “panic hardware,” a latching device that allows egress from the structure in an emergency. See U.B.C. § 3317(d). We are not convinced that the Horseman’s Park barn area is a “Group A Occupancy,” nor are we convinced that the west gate is a required exit; we need not decide this issue, however, because even if locking the west gate was a violation of section 3317(d), the violation would not be negligence per se in this case.
*87Ashwood argues that the Code is a “safety enactment.” As discussed above, however, Ashwood herself was never in any danger; she was simply in a hurry to get from one part of Horseman’s Park to another and chose, unwisely it turns out, to climb the fence rather than exiting through the open south gate. Clearly, the Code was not intended to ensure good Samaritans the shortest route from one part of a public facility to another. Under the circumstances, we conclude as a matter of law that Ashwood is not a member of the class of persons the “panic hardware” provision of the building code was meant to protect. Accordingly, even if the Code was violated, the violation was not negligence per se and did not establish a duty owed to Ashwood to keep the west gate unlocked.3
Contractual duty
Ashwood also contends that Respondents owed her a duty to keep the gate unlocked under the lease agreement for Horseman’s Park. According to Ashwood, a duty to keep the gate unlocked-enforceable in tort — may be inferred from the contractual obligations between Respondents. The Horseman’s Park lease between NSHA and Clark County contains several clauses that Ashwood describes as “safety precautions.” For example, the lease provides:
Lessee agrees that no portion of the entries, passages, elevators, ramps, stairways, . . . shall be obstructed or used for any purpose other than for ingress or egress to and from the premises.
Lessee expressly agrees to observe all applicable safety procedures to insure that animals, as well as spectators, are not exposed to unsafe operational conditions.
*88According to Ashwood, these provisions of the contract create a specific duty in Respondents to keep the west gate unlocked.
Ashwood cites Granite Construction Co. v. Rhyne, 107 Nev. 651, 817 P.2d 711 (1991), and Baroco v. Araserv, Inc., 621 F.2d 189 (5th Cir. 1980). In Granite Construction, we recognized that a contractor owed a duty to a driver injured in a collision with a bull arising out of a contract to furnish protective fencing that would prevent livestock from straying upon the highway. Similarly, in Baroco, the United States Court of Appeals for the Fifth Circuit recognized that a contractor owed a duty to a drowned swimmer arising out of a contract to provide lifeguards and lifesaving equipment at a beach. Respondents argue that the above-cited cases are distinguishable. We agree.
In both Granite Construction and Baroco, the plaintiff was clearly among the class of persons the contract was intended to protect (drivers on the highway and swimmers at the beach, respectively) and the injury sustained by the plaintiff was precisely the kind of harm that the contract was intended to obviate (hitting livestock wandering onto the highway and drowning in the water). In the present case, on the other hand, the contractual “safety precautions” in the Horseman’s Park lease were, like the building code provisions, clearly intended to protect visitors who might otherwise be unable to escape a dangerous situation within an area of the park or who might otherwise be injured trying to escape such a dangerous situation because an obstruction blocked the way. As previously stated, Ashwood herself was never in any danger, and a safe and adequate means of exiting the barn area was readily available to her. We therefore conclude that, for the same reason that the statutory safety enactments of the building code could not have given rise to a duty to keep the west gate unlocked in this case, the contractual “safety precautions” of the Horseman’s Park lease cannot have given rise to a duty to keep the west gate unlocked.
CONCLUSION
Neither the common law, Clark County ordinances, nor the Horseman’s Park lease agreement imposed upon Respondents a duty owing to Ashwood to keep the west gate unlocked; we conclude, therefore, that Respondents have negated an essential element of Ashwood’s case. We hold, accordingly, that the district court did not err in entering summary judgment against Ashwood. See Perez, 107 Nev. at 4, 805 P.2d at 591. The judgment of the district court is affirmed.
Steffen, C. J., and Young, J., concur.Finally, although we emphasize that this may be a case to which the *86maxim “danger invites rescue” is applicable, this is not a case where liability for a plaintiff’s injuries may simply be imputed to defendants under the so-called “rescue doctrine.” In order for that doctrine to apply, the defendants must first be liable for the injury to the victim being rescued. See Wagner v. International R.R. Co., 133 N.E. 437, 438 (N.Y. 1921) (Cardozo, C.J.); Estate of Keck v. Blair, 856 P.2d 740 (Wash. Ct. App. 1993). In this case, Ashwood has not alleged that Respondents were responsible for the fall of the rider for whom she was attempting rescue at the time of her own injury.
Clark County has, with certain express exceptions, adopted the U.B.C. by the International Conference of Building Officials (1994 edition) as the building code of Clark County. See Clark County Ordinance § 22.04.010. Accordingly, where applicable, citations are to the U.B.C.
We note in passing that there is some question as to whether the Clark County Building Code is an appropriate basis for application of the negligence per se doctrine. In Price v. Sinnott, we held that “proof of a deviation from an administrative regulation is only evidence of negligence; not negligence per se.” 85 Nev. 600, 605, 460 P.2d 837, 840 (1969) (negligence per se not applicable to violation of safety rule promulgated by Nevada Liquified Petroleum Gas Board). We reasoned that, “This point of view best serves all interests since it accords appropriate dignity to administrative rules and concomitantly affords some leeway for those instances where the rule in issue may be arbitrary and its violation not necessarily unreasonable.” Id. at 605, 460 P.2d at 840.
Although the Clark County Building Code is promulgated as a legislative ordinance, it appears, at least arguably, administrative in nature. Nevertheless, because this issue was neither raised before the district court, nor briefed on appeal, and because resolution of this issue would not affect the outcome of this case, we decline to consider this issue at the present time.