一、DNF屬性相克
光和暗互克,火和冰互克,比如用光屬性打暗屬性會打得多很多,而打其他屬性也會多一點,不過打光屬性的怪就會減了
二、DNF里的4個屬性分別誰克誰?
光克光~~暗克暗~~現在就是這樣的~~本屬性克本屬性
三、如何判斷電腦裝的是34位系統還是64位系統
一、我的電腦》》右鍵》》屬性》》常規,里面沒有發現×64 的,就是32位系統。
二、裝個優化大師,一看就明白。
三、開始》》運行》》cmd+回車》》輸入systeminfo,并回車,找到里面的“系統類型”,32位的顯示×86,64位的顯示×64。
四、安裝Z武器,一看就全部明白!
四、如何比較兩個List的同名屬性的值
數據結構上用Dictionary來放屬性集合會方便一些。排版也比較清楚。
static class Program
{
static void Main(string[] args)
{
List<Constraint> constraints = new List<Constraint>()
{
new Constraint(Height, Rule.GreaterThan, 100),
new Constraint(Name, Rule.Equals, csdn),
};
Dictionary<string, object> p1 = new Dictionary<string, object>()
{
{Height, 110},
{Name, csdn},
{Volume, 280},
{Color, red},
};
Dictionary<string, object> p2 = new Dictionary<string, object>()
{
{Height, 80},
{Name, csdn},
{Volume, 300},
{Color, red},
};
List<Dictionary<string, object>> inputs = new List<Dictionary<string, object>>(){p1, p2};
List<Dictionary<string, object>> validEntities = inputs.Where(x => constraints.All(c => c.Match(x))).ToList();
System.Diagnostics.Debug.Assert(validEntities.Count == 1 && validEntities[0] == p1); // 驗證,只有p1符合要求
}
enum Rule
{
Equals,
GreaterThan,
LessThan,
}
class Constraint
{
public Constraint(string name, Rule rule, object value)
{
this.PropertyName = name; this.Rule = rule; this.Value = value;
}
public string PropertyName { get; private set; }
public Rule Rule { get; private set; }
public object Value { get; private set; }
public bool Match(IDictionary<string, object> bag)
{
if (bag != null && bag.ContainsKey(this.PropertyName))
{
int diff = System.Collections.Comparer.Default.Compare(bag[PropertyName], this.Value);
if (diff == 0 && this.Rule == Rule.Equals) return true;
if (diff < 0 && this.Rule == Rule.LessThan) return true;
if (diff > 0 && this.Rule == Rule.GreaterThan) return true;
}
return false;
}
}
