using System.Collections.Generic;
public static void Main()
var attributes = new Attribute[] {
new Attribute{WhatAttri=AttributeType.maxhp, amount=6 },
new Attribute{WhatAttri=AttributeType.str, amount=4 },
new Attribute{WhatAttri=AttributeType.dex, amount=3 },
var attributesModifier = new Attribute[] {
new Attribute{WhatAttri=AttributeType.str, amount=-9 },
new Attribute{WhatAttri=AttributeType.@int, amount=-7 },
new Attribute{WhatAttri=AttributeType.wis, amount=-5 },
var newAttributes = attributes
.Concat(attributesModifier)
.GroupBy(x => x.WhatAttri)
amount = group.Sum(g => g.amount)
public AttributeType WhatAttri { get; set; }
public float amount { get; set; }
public enum AttributeType
maxhp, str, dex, @int, wis