Meeskond "Valmis!"

From ICO wiki
Revision as of 22:13, 16 May 2010 by Mkurm (talk | contribs) (→‎XML)
Jump to navigationJump to search

Meeskond "Valmis!"

Projekti kirjeldus, failid jne.

XML

Kuna olen ise pokkerihuviline, siis tegin XML faili, mis kirjeldab ühte pokkeri mängu. Mäng koosneb mängu andmetest (tüüp, valuuta, panused), mängija andmetest (nimi, hüüdnimi, sünniaeg) ja kätest, mis antud mängu jooksul läbi mängiti. Käsi omakorda koosneb siis kaartidest (mängija kaardid, laua kaardid) ja toimingutest(raise, call, all-in, fold jne.).

XML Fail (pokker.xml)

<?xml version="1.0" encoding="utf-8" ?>
<game id="99483673666" xmlns="http://tempuri.org/pokker.xsd"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://tempuri.org/pokker.xsd pokker.xsd">
  <type>Cash-Game</type>
  <playType>Texas Hold'em</playType>
  <currency>EUR</currency>
  <playerCount>6</playerCount>
  <blinds>
    <sb>0.5</sb>
    <bb>1</bb>
    <ante>0</ante>
  </blinds>
  <player>
    <nickname>OzzuPozzu</nickname>
    <firstName>Marko</firstName>
    <lastName>Kurm</lastName>
    <dateOfBirth>1984-07-05</dateOfBirth>
  </player>
  <hands>
    <count>2</count>
    <hand id="134954854">
      <position>3</position>
      <duration>126</duration>
      <cards>
        <player>
          <card>
            <suit>Hearts</suit>
            <value>10</value>
          </card>
          <card>
            <suit>Spades</suit>
            <value>6</value>
          </card>
        </player>
        <community>
          <card>
            <suit>Clubs</suit>
            <value>6</value>
          </card>
          <card>
            <suit>Spades</suit>
            <value>6</value>
          </card>
          <card>
            <suit>Diamonds</suit>
            <value>2</value>
          </card>
          <card>
            <suit>Hearts</suit>
            <value>3</value>
          </card>
          <card>
            <suit>Diamonds</suit>
            <value>Q</value>
          </card>
        </community>
      </cards>
      <actions>
        <action>
          <type>SB</type>
          <amount>0.5</amount>
        </action>
        <action>
          <type>Raise</type>
          <amount>2</amount>
        </action>
        <action>
          <type>Call</type>
          <amount>3.5</amount>
        </action>
        <action>
          <type>MUCK</type>
          <amount>0</amount>
        </action>
        <action>
          <type>Win</type>
          <amount>8.5</amount>
        </action>
      </actions>
    </hand>
    <hand id="55678345">
      <position>3</position>
      <duration>126</duration>
      <cards>
        <player>
          <card>
            <suit>Clubs</suit>
            <value>J</value>
          </card>
          <card>
            <suit>Clubs</suit>
            <value>A</value>
          </card>
        </player>
        <community>
          <card>
            <suit>Hearts</suit>
            <value>J</value>
          </card>
          <card>
            <suit>Spades</suit>
            <value>J</value>
          </card>
          <card>
            <suit>Clubs</suit>
            <value>K</value>
          </card>
          <card>
            <suit>Clubs</suit>
            <value>3</value>
          </card>
          <card>
            <suit>Clubs</suit>
            <value>9</value>
          </card>
        </community>
      </cards>
      <actions>
        <action>
          <type>Call</type>
          <amount>2</amount>
        </action>
        <action>
          <type>Raise</type>
          <amount>5</amount>
        </action>
        <action>
          <type>All-In</type>
          <amount>15</amount>
        </action>
        <action>
          <type>Muck</type>
          <amount>0</amount>
        </action>
        <action>
          <type>Win</type>
          <amount>44</amount>
        </action>
      </actions>
    </hand>
  </hands>
</game>

XSD Fail (pokker.xsd)

<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="pokker"
    targetNamespace="http://tempuri.org/pokker.xsd"
    elementFormDefault="qualified"
    xmlns="http://tempuri.org/pokker.xsd"
    xmlns:mstns="http://tempuri.org/pokker.xsd"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
  
  <xs:element name="game">
	<xs:complexType>
	  <xs:all>
	    <xs:element name="type" type="xs:string" minOccurs="1" maxOccurs="1"></xs:element>
	      <xs:element name="playType" type="xs:string" minOccurs="1" maxOccurs="1"></xs:element>
	      <xs:element name="currency" type="xs:string" minOccurs="1" maxOccurs="1"></xs:element>
	      <xs:element name="playerCount" type="xs:string" minOccurs="1" maxOccurs="1"></xs:element>
	      <xs:element name="blinds" type="typeBlinds" minOccurs="1" maxOccurs="1"></xs:element>
	      <xs:element name="player" type="typePlayer" minOccurs="1" maxOccurs="1"></xs:element>
	      <xs:element name="hands" type="typeHands" minOccurs="1" maxOccurs="1"></xs:element>
	    </xs:all>
	  <xs:attribute name="id" type="xs:integer" use="required"></xs:attribute>
	</xs:complexType>
  </xs:element>
  
  <xs:complexType name="typeBlinds">
    <xs:all>
      <xs:element name="sb" type="xs:decimal" minOccurs="1" maxOccurs="1"></xs:element>
      <xs:element name="bb" type="xs:decimal" minOccurs="1" maxOccurs="1"></xs:element>
      <xs:element name="ante" type="xs:decimal" minOccurs="1" maxOccurs="1"></xs:element>
    </xs:all>
  </xs:complexType>

  <xs:complexType name="typePlayer">
    <xs:all>
      <xs:element name="nickname" type="xs:string" minOccurs="1" maxOccurs="1"></xs:element>
      <xs:element name="firstName" type="xs:string" minOccurs="0" maxOccurs="1"></xs:element>
      <xs:element name="lastName" type="xs:string" minOccurs="0" maxOccurs="1"></xs:element>
      <xs:element name="dateOfBirth" type="xs:date" minOccurs="0" maxOccurs="1"></xs:element>
    </xs:all>
  </xs:complexType>

  <xs:complexType name="typeHands">
    <xs:sequence>
      <xs:element name="count" type="xs:integer" minOccurs="1" maxOccurs="1"></xs:element>
      <xs:element name="hand" type="typeHand" minOccurs="1" maxOccurs="unbounded"></xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="typeHand">
    <xs:all>
      <xs:element name="position" type="xs:integer" minOccurs="1" maxOccurs="1"></xs:element>
      <xs:element name="duration" type="xs:integer" minOccurs="1" maxOccurs="1"></xs:element>
      <xs:element name="cards" type="typeCards" minOccurs="1" maxOccurs="1"></xs:element>
      <xs:element name="actions" type="typeActions" minOccurs="1" maxOccurs="1"></xs:element>
    </xs:all>
    <xs:attribute name="id" type="xs:integer" use="required"></xs:attribute>
  </xs:complexType>

  <xs:complexType name="typeCards">
    <xs:all>
      <xs:element name="player" type="typePlayerCards" minOccurs="1" maxOccurs="1"></xs:element>
      <xs:element name="community" type="typeCommunityCards" minOccurs="1" maxOccurs="1"></xs:element>
    </xs:all>
  </xs:complexType>

  <xs:complexType name="typePlayerCards">
    <xs:sequence>
      <xs:element name="card" type="cardType" minOccurs="1" maxOccurs="unbounded"></xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="typeCommunityCards">
    <xs:sequence>
      <xs:element name="card" type="cardType" minOccurs="1" maxOccurs="unbounded"></xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="cardType">
    <xs:all>
      <xs:element name="suit" type="xs:string" minOccurs="1" maxOccurs="1"></xs:element>
      <xs:element name="value" type="xs:string" minOccurs="1" maxOccurs="1"></xs:element>
    </xs:all>
  </xs:complexType>

  <xs:complexType name="typeActions">
    <xs:sequence>
      <xs:element name="action" type="typeAction" minOccurs="1" maxOccurs="unbounded"></xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:complexType name="typeAction">
    <xs:all>
      <xs:element name="type" type="xs:string" minOccurs="1" maxOccurs="1"></xs:element>
      <xs:element name="amount" type="xs:decimal" minOccurs="1" maxOccurs="1"></xs:element>
    </xs:all>
  </xs:complexType>
  

</xs:schema>