Example #1
0
File: Unit.cs Project: tnargy/MyCiv
 override public void SetHex(Hex newHex)
 {
     if (Hex != null)
     {
         Hex.RemoveUnit(this);
     }
     base.SetHex(newHex);
     Hex.AddUnit(this);
 }
Example #2
0
    public void SetHex(Hex newHex)
    {
        Hex oldHex = Hex;

        if (Hex != null)
        {
            Hex.RemoveUnit(this);
        }

        Hex = newHex;
        Hex.AddUnit(this);

        if (OnUnitMoved != null)
        {
            OnUnitMoved(oldHex, newHex);
        }
    }