public Reaction( GenericReader reader ) { int version = reader.ReadEncodedInt(); switch ( version ) { case 0: { m_Faction = Faction.ReadReference( reader ); m_Type = (ReactionType) reader.ReadEncodedInt(); break; } } }
public void WriteReference(GenericWriter writer, Faction faction) { ;}
private void ChangeReaction( Faction faction, ReactionType type ) { if ( faction == null ) { switch ( type ) { case ReactionType.Ignore: Say( 1005179 ); break; // Civilians will now be ignored. case ReactionType.Warn: Say( 1005180 ); break; // Civilians will now be warned of their impending deaths. case ReactionType.Attack: return; } } else { TextDefinition def = null; switch ( type ) { case ReactionType.Ignore: def = faction.Definition.GuardIgnore; break; case ReactionType.Warn: def = faction.Definition.GuardWarn; break; case ReactionType.Attack: def = faction.Definition.GuardAttack; break; } if ( def != null && def.Number > 0 ) Say( def.Number ); else if ( def != null && def.String != null ) Say( def.String ); } m_Orders.SetReaction( faction, type ); }
public Reaction( Faction faction, ReactionType type ) { m_Faction = faction; m_Type = type; }
public void SetReaction( Faction faction, ReactionType type ) { Reaction reaction = GetReaction( faction ); reaction.Type = type; }
public Reaction GetReaction( Faction faction ) { Reaction reaction; for ( int i = 0; i < m_Reactions.Count; ++i ) { reaction = (Reaction) m_Reactions[i]; if ( reaction.Faction == faction ) return reaction; } reaction = new Reaction( faction, ( faction == null || faction == m_Guard.Faction ) ? ReactionType.Ignore : ReactionType.Attack ); m_Reactions.Add( reaction ); return reaction; }