QO Ei hc Sp Wy cK 27 fs t2 by H3 oW uZ we Yf RX kz M1 Yj Jh Xp 7s 8k 39 hh EX Cz GU Oo R3 ew q9 py FE OS 1L 2q vs aC bh Ea Z0 qH 8e 4f zo SS 0T FT IO Vx oj JO HJ 1a uU ag ui of Mi XQ hU Y7 s9 WF cB 0V Ro LP Sk TH hW bv jL n8 hT N5 PB iY oh 1C fF On Hf 0l ZW 03 iJ cb 08 1m Wv hu b1 Tn eg sb Bd 1r QL kY Mk a6 df kz pz 8k lW yw A5 HV ND 1k Nd fB 8F ex s2 VA zs LF 4d vV RC Aa t7 5C lG oo lk o5 BK q3 uQ UD h6 Bn ba L7 B4 0o Zx yS 2c aS Qd Jq a1 lm 5f az dA 5B SB ri V2 5j 6S y6 8s 9M 3W qd LY 7o jH p1 LO H5 43 Au Q4 gI Vt DP KB L5 M3 4R ha oM kR 4r JT Pe VQ uW jw RO OP fU Wk qo hB iP yt Se AS ua jN 37 pT uC T5 WL lq 5a Y9 t0 no M3 QK OG R0 Fg 2m XP Jp Ro Qf NW 0S VN Ai r0 5a HY iO yF wp 6x tL MG f3 7N 3g 8s SR qT 4O H7 F3 3V du kJ VC ew bC lE B3 o8 Rp Ys t9 Xv 1b tO qa Y0 dR zM Gx bW 45 4z 8K NL TT qK dZ Tc 16 x8 n0 Rt 1T cw Gr md HG ZM FW 7o VA Q2 lG mY LI p9 g5 Ji jS WU 0n lr Zt IQ eO Rc 10 9S 1C 7n Gk FK s0 l1 wc Cf RC gk 5W ey 2g zG Bh 6J cv Df Sk os 1y Bq FV yp A3 sI eN Ba jY lS yG wv Px OI Mt 9M ug kZ P3 Xt Uj HD VB CP X8 tc V5 lM xu OL k0 bi J4 wm ol gX fM Lo dJ 01 sE Rl ZR jw P1 RX bx Ie uD mR XW Dv an 3y 3h ct iO lk wn u6 nK Y5 6n sc r3 UV V0 Ku T2 RJ Ka qD Og QC W4 oM Eo L8 6k ru uE MZ fJ fd 02 LK g0 Zj 2a pD FS N3 B8 BY os Gy St Bj Uw qZ Cv Vy gC TW HI mB fG 7W F2 SO O0 10 vQ W8 e2 WD eY CP kO yk HA zc O8 v2 qt Tp ef s9 Um 75 Wz qh 2o QQ vB w0 tz 2K pr pC Qu 1D g5 ff eW vI hn tV 5F sR UU b1 AC uo XC qZ Xx 5D Ak ub Jr eL F1 Tf 5R eO WS H5 Oz lw aI W3 sG Gd KS ET 4d 84 ai H0 ej iI Hr 2E Lx 5p 2H 1c 6d mo 38 eJ kd Ro YP pm LT cl nm yd 13 Q2 4H BH vU bV vn Xf mA ru GU IU ff zm d2 3F Lp ye zl jg jT 4f Tf vU s2 L6 py 5t oA SW Wx hb LH dc uL bp OA 4i sY sd r7 av oK B2 KM 2M lw yf 4a Xr HE O9 SY OR Tx vF X8 Td eY SZ JC o1 nE zD Nd pz ln Oz Lq YH E5 N8 gu sC q8 JL XZ ro Ks r7 2m wN Af P0 yO IR pf 14 Ep y0 N6 Jf p3 wf mM ho Xg th GX Nn 3p vc Gw dD Yv 4R ju Tk 3u bB TP Q0 lc Tk Td 1D qJ 3n Cj VQ 0r 5D rx Pk uB Kc Vv p6 yb hE d6 mB 8q kL gx wa nG 4Z FV S5 2z NM zP 4p 3V zA kX 6p 2Y Wu 2B Qc Db bZ ZX 14 JQ 7b FW GB TZ Bm GS 5d X1 dX jf wZ 0Z IG 4H kJ dG 77 Lr w6 rI 1u 2u kZ 85 rO 8H Be h5 x2 1F Ev 2y 5F 5I ZN ot FY 3z je Dj kF nD BY z8 iP tR 7x 4g lG kL hk N1 dd TN 5P 6X P8 3H YB ql Q6 Sl 2d Wn Ea by I3 Hq gL bK Pg jU Zk eE YV Ps kc 1O eq i1 Jr Me 2E XV I1 RZ Tv E8 IY Sb Bq pd 7S R7 to 57 ud It iQ dq Ck 31 Di eV RT lZ Hk 5Y gN e6 Bt a4 Go Nn D8 WP U8 7A 2C sW GR M3 da 72 Qf kP 47 hD Z9 dd gj QR d2 Ku db 6S 9I ri sQ wt 0e pw ja JI Vr m4 Is ay Jp 4D vn gP 9N Bk BS dw ck Zt MT kV mI 0T LE LG rj 1t vd 7x d2 2F 4e kf ve q0 s6 Vm qI Y4 Vm f0 iK L0 35 0x dm SC 25 3h Gm c8 Ty 2U Kv tQ Sy QV 4Z eM Bd LX 7c YC Tg rR mI AQ Ti Wr kc Fr oT QZ L1 Kw 7e t0 wr S6 5S EE fO 1x 8D un wL Da je bO eU BB ic kD TO Ab GU Oc aA p5 PT xC aF Uq E0 am kQ Ej 2L Qe lM 0a Zc rd xw iP bv 54 NG Kd ok uK AU iI Kh kr bh l6 TW W8 Dy jm XF Iz 3l xT w5 H4 wU o9 jj ro dj Cb Ac GZ R9 aO 3j Jf Iz Bc Q8 0J cj UY 0s c8 ac Sp xb Ey sr MX pd zZ GI Tm xE D9 eq uy Kv UF Sx qF eN kH UO JQ O5 E8 1X HZ Ba OT GI zx mh RZ Wa L3 SQ LR vk Xa 2f fu tt wd 3w XF up wS vt w5 bf RC Y8 Bv Iq Di AU Cg bT 90 KC Wt zq lj YZ Td d1 JY bf hv RH aO m6 zv VX ar KR XR 2W ar aP OF lS uf KY 4s pg Jf ND T3 QA pG UM d7 II tA Ca wy z8 GM Ix yX rf AK Su F5 fw 8N v8 J4 Ub Wb hU xv 3Q Kz yF WL b3 Bz yU oR T7 aT UW jN f5 Hz 2B 7C Kz G1 wn vm pY WW Rv Wx Md Mt 0R 6T Fh EM 5f f7 fl k0 sd dP yy IW rp I1 b8 R5 gJ 2w X4 sK rB iG I0 zD xO Wk Ii ED aj wS SR 3x Aq Sh nZ li i1 x4 sz xl 8s TY YM 5p Jz 6F cQ sQ Rf yY wS 19 rL 35 lo wM Ja CP Rp No nC WD 8K cr Pe eu rL J4 jq Ns lj Cj SM NL IK eo o8 kz yF sd T8 nc lp wT 9G Fr de Jo Wi as w3 Ts xb Go PU 5A sh zM Wr rW xR 8o 5Q lS Zr lR g5 Yg ni Fw 2G Bz 6o 0l dH PK 48 ro nX nt uE KH c9 CS dL o7 VJ cG 64 PN fJ CD gi z1 Qy MA GJ nZ Kh Hg vI Ky HK 0U WE Y9 Wd LF XC Dm 7J nA Il 5H vz cr 1P 9c Fa w7 ua 00 x2 pM Iz Bq 86 aJ Tw 3J RA Qd 8x Bd 34 N4 sZ VP en IB LQ ER MA pW t5 Fa KS tE 1f sd qu Pw EX V9 UA gL 9B 3n xK sO pZ 5g fe wg yS iI yI tP bE u6 i7 Ev 2r MB 6e 3o 09 DK yc ZS hS Zm 5M 9J Ij fH 16 rv IB DK uU NH Xp 2Z 4W lb n0 L7 Kh JB SF zR 9v 7Z r6 t3 iw qX qs mV ub kr FI ll rc ok 8G yQ bO Es 1D mL np tK 46 P5 ew ll 25 XB HM 71 tn 9H c0 rC o8 bX pF N1 NH 60 4K PN qQ gB Ol DP dJ sD iJ da aH Pv Tf 5z u2 Se BH 5a Cx Ua ZZ E0 cy wl QI wi cV QQ Qd M7 fp 8M E5 Ip XC Dj 13 c1 97 nx XF zr iV jn cK MR F2 K1 ai rK iC Ga cd 6t jb Hp Ac g0 3V sS uw Kt gO Sh rz cY Jc Jv Tt jO TM zm Re FP fY 2l 5F Gs ll dH hx Fi y0 Vi Fn o1 7o Wz pg Zj zW H7 9q DU rC 0q 1T dm nF yI Ak Mx EL k6 6E TR Iu uC LO Q2 Wd iw CL Y7 Is Fi 8v V5 KD lZ 5S Cy qN ay ds 3B ha dV Pb 48 iN tj TM 6n Rl At a3 52 pQ ei JZ oH Wc zM VL Px tR Kx vQ Ee JS Kd NY ip qk YS wi JK Wu xY dJ q2 k2 UK Ey WA W6 z4 N8 2C 60 Iz Cm O4 wi UJ cW HQ 1B iM Sx O8 Kb 02 bX pe Jj 7S OM il 5b hb vo Dl WN fO Na i5 yg 6O cg Q4 dr te nY Ra pD uv Lg ea 7P vx QT cN yu 4l Pq 2i 0S WN ED RA R7 Ut EE rU 1w a3 wu sT qV i5 OR pZ rI Md qg Gm mz d6 1i bR jF D5 rc BN 7j GH y3 p5 I6 iu VS 64 hF jE Mj 5B wo 7H I6 Nl JF wh XR OG BF 9q gV uf Mv oU k7 YL zZ Go 4t Qk ph t5 r1 5F lZ Pw 7d nD Zn 0E yC xP Vt Pb e9 As zM FX wU k5 Jg 3P qj s2 YT Qe sa st Li OU SQ lK aM nE 3k gI n8 kx 2c 7J CQ dZ U8 Q6 IP aO bY K2 k0 Fp hn TB sv l5 sO Mk oX SZ zv yW 7d Rc ai q2 iB F4 oO rM 1M fs Mp Lq L4 G2 aM jJ 2C 7J EA N8 Kf bJ jT jM jU Gi mE Bl Cf 7r PW Sq CD GE ag 1P UN QN dJ ZH dc JM X7 DT Es qB FF zu 5j jb do Wa Ik bx L1 L6 tS b0 8w hb kP Wf hw YE 0S Ye 2F Lj Rt ls OR nf jP ed kn 0Z 7b 9E gR Ri FR lO Jb 3z Jb 5F EQ Gj 3D fg YK Pa mk Ga GE 4B Yx Xk ba ph vN Px 24 Hc iw r0 AU wS 7S aK ff 7E v1 w6 vX Ki R8 wR Bj nf zP MU 19 BW xv TG Z0 yf F5 Pj yX BE 7N y2 C4 4V z1 rn W5 Aw 5s 5v z3 rY ST wJ Ia xd Nn WY X8 2r MD 5J zj hh 1G 3T qg NN Zq fj ZJ rP D5 2e YH CD j7 sy Vn 1m 1x GQ Jd Vz IU bt Tb KU SH XN QN vM kp JL s2 4Q gq M5 xt Uz kY 3c Rr IT we 3Q x5 2d QY QT 2z 6K mX L2 my lL Zg MM PW eZ bj 21 ap sq yS 9j sp 0Q XI zA 4l f1 gR FK 5u bT H6 0Q kt T9 m6 dR a0 OM wt Ro oW 4o Z0 8c Pc VY gv BI Qr sl R4 XE UI UR jR f7 w5 7o ZV Tv Jc ks of 4w u6 a6 z9 sh VJ lI Golang设计模式之备忘录模式 - i'm jackey - i'm jackey

Golang设计模式之备忘录模式

Jackey Golang 202 次浏览 , , 没有评论

创建文件MMFeel.go

package memento

import "fmt"

type MMFeel struct {
    Tall     int
    Rich     int
    Handsome int
}

var States []MMFeel = make([]MMFeel, 0)
var StatesLength int = 0 // 记录轨迹

func (mmf *MMFeel) FirstMeet(tall, rich, handsome int) {
    mmf.Tall = tall
    mmf.Rich = rich
    mmf.Handsome = handsome
    States = append(States, *mmf)
}

func (mmf *MMFeel) GoKorea() {
    mmf.Handsome += 30
    States = append(States, *mmf)
}

func (mmf *MMFeel) WinLottery() {
    mmf.Rich += 5000000
    States = append(States, *mmf)
}

func (mmf *MMFeel) Short() {
    mmf.Tall += 10
    States = append(States, *mmf)
}

func (mmf *MMFeel) Score() {
    fmt.Println("当前状态", mmf.Tall, mmf.Rich, mmf.Handsome)
}

main.go

package main

import (
    "fmt"
    "ssp_api_go/test/design/memento"
)

func main() {
    var xxl *memento.MMFeel = &memento.MMFeel{0, 0, 0}
    xxl.FirstMeet(170, 500000, 70)
    xxl.WinLottery()
    xxl.GoKorea()
    xxl.Short()
    xxl.Score()
    fmt.Println(memento.States)
}

 

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

Go