make gitbook

This commit is contained in:
numbbbbb
2014-06-14 20:51:32 +08:00
parent e00caf63d5
commit 31f083eb83
68 changed files with 1893 additions and 1795 deletions

12
chapter2/21_Protocols.html Executable file → Normal file
View File

@ -46,7 +46,7 @@
<div class="book" data-level="2.21" data-basepath=".." data-revision="1402677669306">
<div class="book" data-level="2.21" data-basepath=".." data-revision="1402750255397">
<div class="book-header">
<!-- Actions Left -->
<a href="#" class="btn pull-left toggle-summary" aria-label="Toggle summary"><i class="fa fa-align-justify"></i></a>
@ -268,7 +268,7 @@
<li class="chapter " data-level="2.12" data-path="chapter2/12_Subscripts.html">
<a href="../chapter2/12_Subscripts.html">
<i class="fa fa-check"></i> <b>2.12.</b> 附属脚本
<i class="fa fa-check"></i> <b>2.12.</b> 下标脚本
</a>
@ -520,7 +520,7 @@
<a href="../chapter2/11_Methods.html" title="方法" class="chapter done " data-progress="2.11" style="left: 18.42105263157895%;"></a>
<a href="../chapter2/12_Subscripts.html" title="附属脚本" class="chapter done " data-progress="2.12" style="left: 21.05263157894737%;"></a>
<a href="../chapter2/12_Subscripts.html" title="下标脚本" class="chapter done " data-progress="2.12" style="left: 21.05263157894737%;"></a>
<a href="../chapter2/13_Inheritance.html" title="继承" class="chapter done " data-progress="2.13" style="left: 23.68421052631579%;"></a>
@ -587,7 +587,7 @@
<div class="page-inner">
<section class="normal" id="section-gitbook_127">
<section class="normal" id="section-gitbook_74">
<blockquote>
<p>翻译geek5nan</p>
@ -863,7 +863,7 @@ game.play()
}
</code></pre><p>通过<code>扩展</code>为上一节中提到的<code>Dice</code>类遵循<code>TextRepresentable</code>协议</p>
<pre><code>extension Dice: TextRepresentable {
cun asText() -&gt; String {
func asText() -&gt; String {
return &quot;A \(sides)-sided dice&quot;
}
}
@ -1005,7 +1005,7 @@ class Country: HasArea {
var legs: Int
init(legs: Int) { self.legs = legs }
}
</code></pre><p><code>Circle,Country,Animal</code>并没有一个相同的基类,所以采用<code>AnyObject</code>类型的数组来装载在们的实例,如下所示:</p>
</code></pre><p><code>Circle,Country,Animal</code>并没有一个相同的基类,所以采用<code>AnyObject</code>类型的数组来装载在们的实例,如下所示:</p>
<pre><code>let objects: AnyObject[] = [
Circle(radius: 2.0),
Country(area: 243_610),