@@ -0,0 +1,616 @@
+package com.jikexueyuan.game2048;%0A%0Aimport android.content.Context;%0Aimport android.widget.FrameLayout;%0Aimport android.widget.TextView;%0A%0Apublic class Card extends FrameLayout %7B%0A%0A%09public Card(Context context) %7B%0A%09%09super(context);%0A%0A%09%09label = new TextView(context);%0A%0A%09%09LayoutParams lp = new LayoutParams(-1, -1);%0A%09%09label.setTextSize(32);%0A%09%09addView(label, lp);%0A%0A%09%09setNum(0);%0A%09%7D%0A%0A%09private int num;%0A%0A%09public int getNum() %7B%0A%09%09return num;%0A%09%7D%0A%0A%09public void setNum(int num) %7B%0A%09%09this.num = num;%0A%0A%09%09label.setText(num + %22%22);%0A%09%7D%0A%0A%09private TextView label;%0A%0A%09public boolean equals(Card card) %7B%0A%09%09return getNum() == card.getNum();%0A%09%7D%0A%7D%0A

实现2048游戏卡片类