private void ChangeState() { if (State != RebellionState.Invation) { if (Point >= 100) { State = RebellionState.Alert; } else if (Point > 90) { State = RebellionState.Warning; } else if (Point > 70) { State = RebellionState.Caution; } else if (Point > 50) { State = RebellionState.Attention; } else { State = RebellionState.Safety; } } }
public int EndInvation(IRebellionPointOperator instance) { if (instance == null) { return(-1); } if (State != RebellionState.Invation) { return(-2); } Point = 0; State = RebellionState.Safety; return(0); }
public bool StartRebellion(Api_TurnOperator instance) { if (instance == null) { return(false); } if (State != RebellionState.Alert) { return(false); } double randDouble = Utils.GetRandDouble(0.0, 100.0, 1.0, 1); if (randDouble <= 65.0) { State = RebellionState.Invation; return(true); } return(false); }
protected override void setProperty(XElement element) { Rid = int.Parse(element.Element("_rid").Value); Point = int.Parse(element.Element("_point").Value); State = (RebellionState)(int)Enum.Parse(typeof(RebellionState), element.Element("_state").Value); }