设计模式简明C++

//策略模式
class M
{
public:
M(SBase * s):m_s(s){}
int f(){
return m_s->f();
}
private:
SBase * m_s;
};

class SBase
{
public:
virtual int f()=0;
};

class S1:public SBase
{
int f();
};

class S2:public SBase
{
int f();
};

//使用
M(new S1)
M.f();

//外观模式
class S1
{
public:
int f1(){}
};

class S2
{
public:
int f2(){}
};

class M
{
public:
void f()
{
S1 s1;
S2 s2;
return s1.f1()+s2.f2();
}
};

//适配器
class Old
{
public:
int oldf(){}
};

class ABase
{
public:
virtual int f()=0;
};

class A:public ABase
{
public:
int f(){
Old old;
return old.oldf();
}
}

class M
{
public:
f()
{
ABase a;
a.f();
}
};

//模板模式
class TBase
{
public:
int Constf(){
return 1;
}
virtual int Changingf1()=0;
virtual int Changingf2()=0;
}

class T:public TBase
{
public:
int Changingf1(){return 2;}
int Changingf2(){return 3;}
}
//桥接 实现A1+B2
class BBase
{
public:
virtual int b()=0;
};

class B1:public BBase
{
public:
int b(){return 100;}
};

class B2:public BBase
{
public:
int b(){return 1000;}
};

class ABase
{
public:
ABase(BBase *b):m_b(b){}
protected:
BBase * m_b;
};

class A1:public ABase
{
public:
A1(BBase *b):ABase(b){}
int a(){return 10+m_b->b();}
};

class A2:public ABase
{
public:
A2(BBase *b):ABase(b){}
int a(){return 1+m_b->b();}
};

//使用
A1 a(new B2);
a.a();

只有桥接调试了 因为这个搞得不是很明白……

Read More

pop3咒语大全

angel of death: Mortaza
volcano : Halaa’tanka
earthquake : Larkayee
erode : Darsanko
firestrom :Toomaga
tornado:Shenako
swamp:Ou’tanga
flatten: Harneyalu
land bridge:Tuscatsi
lightning:Shoo’kar
hypnotise:Nocktam
swarm:Hoo’narga
invisabily:Shetanko
magical shield:X
blast: Ta’ka
convert:Sunam

bloodlust :AHH
Armageddon :X
teleport :AH~~

每个都听了3边以上应该不会错吧

Read More

jingle bells

jingle bells, jingle bells
jingle all the way!
o what fun it is to ride
in a one-horse open sleigh.

dashing through the snow
on a one-horse open sleigh,
over the fields we go,
laughing all the way,
bells on bob’s tail ring,
making spirits bright,
what fun it is to ride and sing
a sleighing song tonight.

想念李中华……

Read More