public void SetPosition(ChickenUnitState unitState, DirectionalPosition position) { #region Argument Check if (unitState == null) { throw new ArgumentNullException("unitState"); } #endregion _unitToPositionMap[unitState.Unit] = position; }
public DirectionalPosition GetPosition(ChickenUnitState unitState) { #region Argument Check if (unitState == null) { throw new ArgumentNullException("unitState"); } #endregion return(_unitToPositionMap[unitState.Unit]); }
public MoveInfo Get(ChickenUnitState unitState) { #region Argument Check if (unitState == null) { throw new ArgumentNullException("unitState"); } #endregion return(this.InnerMap.GetValueOrDefault(unitState.Unit)); }
public bool TryGetPosition(ChickenUnitState unitState, out DirectionalPosition position) { #region Argument Check if (unitState == null) { throw new ArgumentNullException("unitState"); } #endregion return(_unitToPositionMap.TryGetValue(unitState.Unit, out position)); }
public void Set(ChickenUnitState unitState, MoveInfo move) { #region Argument Check if (unitState == null) { throw new ArgumentNullException("unitState"); } #endregion if (move == null || unitState.IsDead) { this.InnerMap.Remove(unitState.Unit); } else { this.InnerMap[unitState.Unit] = move; } }