Skip to content

Commit

Permalink
container/vector was removed from official tree.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattn committed Nov 28, 2011
1 parent 803213b commit 36b4c88
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions oppai.go
@@ -1,28 +1,26 @@
package oppai

import "container/vector"

type Oppai struct {
count int;
cmd vector.Vector;
cmd []map[string]string
}

func (self *Oppai) Massage() *Oppai {
self.cmd.Push(map[string] string { "name": "Massage", "message": "" } );
self.cmd = append(self.cmd, map[string] string { "name": "Massage", "message": "" });
return self;
}

func (self *Oppai) Oppai(msg string) *Oppai {
self.cmd.Push(map[string] string { "name": "Oppai", "message": msg } );
self.cmd = append(self.cmd, map[string] string { "name": "Oppai", "message": msg } );
return self;
}

func (self *Oppai) Done() (buf string) {
var c int = 0;

for i := 0; i < self.cmd.Len(); i++ {
var cmd string = self.cmd.At(i).(map[string] string)["name"];
var msg string = self.cmd.At(i).(map[string] string)["message"];
for i := 0; i < len(self.cmd); i++ {
var cmd string = self.cmd[i]["name"];
var msg string = self.cmd[i]["message"];

if cmd == "Massage" {
buf += doneMassage();
Expand All @@ -37,7 +35,7 @@ func (self *Oppai) Done() (buf string) {
}
}

self.cmd.Init(0);
self.cmd = make([]map[string]string, 0)
return buf;
}

Expand Down

0 comments on commit 36b4c88

Please sign in to comment.