Difference between revisions of "CreateCity"

From CMSC 420
(Created page with "Creates a city (a vertex) with the specified name, coordinates, radius, and color (the last two attributes will be used in later project parts). A city can be successfully cre...")
 
m
Line 17: Line 17:
 
== <success> Example ==
 
== <success> Example ==
 
<code>
 
<code>
        <success>
+
    <success>
            <command name="createCity"/>
+
        <command name="createCity"/>
            <parameters>
+
        <parameters>
              <name value="Annapolis"/>
+
            <name value="Annapolis"/>
              <x value="12"/>
+
            <x value="12"/>
              <y value="14"/>
+
            <y value="14"/>
              <radius value="15"/>
+
            <radius value="15"/>
              <color value="red"/>
+
            <color value="red"/>
            </parameters>
+
        </parameters>
            <output/>
+
        <output/>
        </success>
+
    </success>
 
</code>
 
</code>

Revision as of 23:33, 10 September 2013

Creates a city (a vertex) with the specified name, coordinates, radius, and color (the last two attributes will be used in later project parts). A city can be successfully created if its name is unique (i.e., there isn't already another city with the same name) and its coordinates are also unique (i.e., there isn't already another city with the same $(x,y)$ coordinate). Names are case-sensitive.

Parameters (In output order)[edit]

  • name
  • x
  • y
  • radius
  • color

Possible <output>[edit]

(none)

Possible <error> types (In priority order)[edit]

  • duplicateCityName
  • duplicateCityCoordinates

<success> Example[edit]

   <success>
       <command name="createCity"/>
       <parameters>
           <name value="Annapolis"/>
           <x value="12"/>
           <y value="14"/>
           <radius value="15"/>
           <color value="red"/>
       </parameters>
       <output/>
   </success>