public void InitializeConveyor(MessageConveyor conveyor) { foreach (var plugin in AllPlugins) { plugin.InitializeConveyor(conveyor); } }
public override void PrintDamageStatistics(MessageConveyor conveyor, StatisticTypes statisticTypeToPrint) { var stats = SelectStatsToPrint(statisticTypeToPrint); if (stats.TotalAttempts == 0 || stats.SuccessAttempts == 0) { return; } conveyor.PushMessage(new OutputToMainWindowMessage(new[] { new TextMessageBlock(" заколоть:", TextColor.BrightYellow), new TextMessageBlock("\t Средний: ", TextColor.White), new TextMessageBlock(((double)stats.TotalDamage / stats.SuccessAttempts).ToString("00.00"), TextColor.BrightWhite), new TextMessageBlock("\t Максимальный: ", TextColor.White), new TextMessageBlock(stats.MaxDamage.ToString(), TextColor.BrightWhite), new TextMessageBlock("\t Шанс: ", TextColor.White), new TextMessageBlock(((double)stats.SuccessAttempts / stats.TotalAttempts).ToString("P"), TextColor.BrightWhite), })); conveyor.PushMessage(new OutputToMainWindowMessage(new [] { new TextMessageBlock("\t\t Шанс отравить: ", TextColor.White), new TextMessageBlock(((double)stats.PoisonAttempts / stats.SuccessAttempts).ToString("P"), TextColor.BrightWhite), })); }
public GroupStatusUnit([NotNull] GroupWidgetControl groupWidget, MessageConveyor conveyor) : base(conveyor) { Assert.ArgumentNotNull(groupWidget, "groupWidget"); _groupWidget = groupWidget; }
public static MessageConveyor CreateNew(RootModel rootModel) { var conveyor = MessageConveyor.CreateNew(rootModel); InitializeConveyorUnits(conveyor); return(conveyor); }
/// <summary> /// Initializes a new instance of the <see cref="RouteUnit"/> class. /// </summary> public RouteUnit([NotNull] RouteManager routeManager, MessageConveyor conveyor) : base(conveyor) { Assert.ArgumentNotNull(routeManager, "routeManager"); _routeManager = routeManager; }
public override void PrintTankStatistics(MessageConveyor conveyor, StatisticTypes statisticTypeToPrint) { var stats = SelectStatsToPrint(statisticTypeToPrint); if (stats.TankAttempts == 0) { return; } conveyor.PushMessage(new OutputToMainWindowMessage(new[] { new TextMessageBlock(" пнуть:", TextColor.BrightRed), new TextMessageBlock("\t Средний: ", TextColor.White), new TextMessageBlock(((double)stats.TotalTankDamage / (stats.SuccessTankAttempts > 0?stats.SuccessTankAttempts:1)).ToString("P"), TextColor.BrightWhite), new TextMessageBlock("\t Максимальный: ", TextColor.White), new TextMessageBlock(stats.MaxTankDamage.ToString(), TextColor.BrightWhite), new TextMessageBlock("\t Шанс: ", TextColor.White), new TextMessageBlock(((double)stats.SuccessTankAttempts / stats.TankAttempts).ToString("P"), TextColor.BrightWhite), })); conveyor.PushMessage(new OutputToMainWindowMessage(new[] { new TextMessageBlock("\t\t Шанс сбить: ", TextColor.White), new TextMessageBlock(((double)stats.BashTankAttempts / (stats.SuccessTankAttempts > 0 ? stats.SuccessTankAttempts: 1)).ToString("P"), TextColor.BrightWhite), new TextMessageBlock("\t Шанс упасть: ", TextColor.White), new TextMessageBlock(((double)stats.FallTankAttempts / (stats.TankAttempts - stats.SuccessTankAttempts > 0 ? stats.TankAttempts - stats.SuccessTankAttempts: 1)).ToString("P"), TextColor.BrightWhite), })); }
private static void InitializeConveyorUnits(MessageConveyor conveyor) { conveyor.AddCommandSerializer(new TextCommandSerializer(conveyor)); //Initialize conveyor with all deserializations conveyor.AddMessageDeserializer(new TextMessageDeserializer(conveyor)); conveyor.AddMessageDeserializer(new ProtocolVersionMessageDeserializer(conveyor)); //Initialize conveyor with message handlers. Handlers added in order processing conveyor.AddConveyorUnit(new CommandSeparatorUnit(conveyor)); conveyor.AddConveyorUnit(new CommandsFromUserLineUnit(conveyor)); conveyor.AddConveyorUnit(new VariableReplaceUnit(conveyor)); conveyor.AddConveyorUnit(new CommandMultiplierUnit(conveyor)); conveyor.AddConveyorUnit(new SubstitutionUnit(conveyor)); conveyor.AddConveyorUnit(new TriggerUnit(conveyor)); conveyor.AddConveyorUnit(new AliasUnit(conveyor)); conveyor.AddConveyorUnit(new HotkeyUnit(conveyor)); conveyor.AddConveyorUnit(new HighlightUnit(conveyor)); conveyor.AddConveyorUnit(new LoggingUnit(conveyor)); conveyor.AddConveyorUnit(new ShowMainOutputUnit(conveyor)); conveyor.AddConveyorUnit(new SendToWindowUnit(conveyor)); conveyor.AddConveyorUnit(new ToggleFullScreenModeUnit(conveyor)); PluginHost.Instance.InitializeConveyor(conveyor); //Add remaining message handlers which should to process message last conveyor.AddConveyorUnit(new ProtocolVersionUnit(conveyor)); conveyor.AddConveyorUnit(new CommandRepeaterUnit(conveyor)); conveyor.AddConveyorUnit(new CapForLineCommandUnit(conveyor)); conveyor.AddConveyorUnit(new ConnectionUnit(conveyor)); }
public override void PrintDamageStatistics(MessageConveyor conveyor, StatisticTypes statisticTypeToPrint) { var stat = SelectStatsToPrint(statisticTypeToPrint); if (stat.TotalAttempts == 0) { return; } //for nice printing if (_skillName.Length < 4) { conveyor.PushMessage(new OutputToMainWindowMessage(new[] { new TextMessageBlock($" {_skillName}: ", TextColor.BrightYellow), new TextMessageBlock("\t Средний: ", TextColor.White), new TextMessageBlock(((double)stat.TotalDamage / stat.TotalAttempts).ToString("00.00"), TextColor.BrightWhite), new TextMessageBlock("\t Максимальный: ", TextColor.White), new TextMessageBlock(stat.MaxDamage.ToString(), TextColor.BrightWhite), })); } else { conveyor.PushMessage(new OutputToMainWindowMessage(new[] { new TextMessageBlock($" {_skillName}:", TextColor.BrightYellow), new TextMessageBlock("\t Средний: ", TextColor.White), new TextMessageBlock(((double)stat.TotalDamage / stat.TotalAttempts).ToString("00.00"), TextColor.BrightWhite), new TextMessageBlock("\t Максимальный: ", TextColor.White), new TextMessageBlock(stat.MaxDamage.ToString(), TextColor.BrightWhite), })); } }
public static MessageConveyor CreateNew(string name, IList <RootModel> allRootModels) { var conveyor = MessageConveyor.CreateNew(name, SettingsHolder.Instance.GetProfile(name), allRootModels); InitializeConveyorUnits(conveyor); return(conveyor); }
/// <summary> /// Initializes a new instance of the <see cref="OutputToAdditionalWindowConveyorUnit"/> class. /// </summary> /// <param name="messageConveyor">The message conveyor.</param> /// <param name="window">The window.</param> public OutputToAdditionalWindowConveyorUnit([NotNull] MessageConveyor messageConveyor, [NotNull] AdditionalOutputWindow window) : base(messageConveyor) { Assert.ArgumentNotNull(messageConveyor, "messageConveyor"); Assert.ArgumentNotNull(window, "window"); _window = window; }
/// <summary> /// Initializes a new instance of the <see cref="GroupStatusUnit"/> class. /// </summary> /// <param name="messageConveyor">The message conveyor.</param> /// <param name="groupWidgetControl">The group widget control.</param> /// <param name="groupStatusViewModel">The group status view model.</param> public GroupStatusUnit([NotNull] MessageConveyor messageConveyor, [NotNull] GroupWidgetControl groupWidgetControl, [NotNull] GroupStatusViewModel groupStatusViewModel) : base(messageConveyor) { Assert.ArgumentNotNull(messageConveyor, "messageConveyor"); Assert.ArgumentNotNull(groupWidgetControl, "groupWidgetControl"); Assert.ArgumentNotNull(groupStatusViewModel, "groupStatusViewModel"); _groupWidgetControl = groupWidgetControl; _groupStatusViewModel = groupStatusViewModel; }
/// <summary> /// Initializes a new instance of the <see cref="RoomMonstersUnit"/> class. /// </summary> /// <param name="messageConveyor">The message conveyor.</param> /// <param name="monstersWidgetControl">The monsters widget control.</param> /// <param name="roomMonstersViewModel">The room monsters view model.</param> public RoomMonstersUnit([NotNull] MessageConveyor messageConveyor, [NotNull] MonstersWidgetControl monstersWidgetControl, [NotNull] RoomMonstersViewModel roomMonstersViewModel) : base(messageConveyor) { Assert.ArgumentNotNull(messageConveyor, "messageConveyor"); Assert.ArgumentNotNull(monstersWidgetControl, "monstersWidgetControl"); Assert.ArgumentNotNull(roomMonstersViewModel, "roomMonstersViewModel"); _monstersWidgetControl = monstersWidgetControl; _roomMonstersViewModel = roomMonstersViewModel; }
public void Dispose() { if (_allModels != null && _allModels.Contains(this)) { _allModels.Remove(this); } if (MessageConveyor != null) { MessageConveyor.Dispose(); } }
public override void PrintTankStatistics(MessageConveyor conveyor, StatisticTypes statisticTypeToPrint) { var stats = SelectStatsToPrint(statisticTypeToPrint); if (stats.TankAttempts == 0) { return; } conveyor.PushMessage(new OutputToMainWindowMessage(new[] { new TextMessageBlock(" подножка:", TextColor.BrightRed), new TextMessageBlock("\t Шанс: ", TextColor.White), new TextMessageBlock(((double)stats.SuccessTankAttempts / stats.TankAttempts).ToString("P"), TextColor.BrightWhite), })); }
public override void PrintDamageStatistics(MessageConveyor conveyor, StatisticTypes statisticTypeToPrint) { var stats = SelectStatsToPrint(statisticTypeToPrint); if (stats.Attempts == 0) { return; } conveyor.PushMessage(new OutputToMainWindowMessage(new[] { new TextMessageBlock(" обезоруж.:", TextColor.BrightYellow), new TextMessageBlock("\t Шанс: ", TextColor.White), new TextMessageBlock(((double)stats.SuccessAttempts / stats.Attempts).ToString("P"), TextColor.BrightWhite) })); }
public override void PrintTankStatistics(MessageConveyor conveyor, StatisticTypes statisticTypeToPrint) { var stats = SelectStatsToPrint(statisticTypeToPrint); if (stats.TotalTankAttempts == 0) { return; } conveyor.PushMessage(new OutputToMainWindowMessage(new[] { new TextMessageBlock(" героич.:", TextColor.BrightRed), new TextMessageBlock("\t Средний: ", TextColor.White), new TextMessageBlock(((double)stats.TotalTankDamage / stats.TotalTankAttempts).ToString("P"), TextColor.BrightWhite), new TextMessageBlock("\t Максимальный: ", TextColor.White), new TextMessageBlock(stats.MaxTankDamage.ToString(), TextColor.BrightWhite), })); }
public void PrintStatistics(MessageConveyor conveyor, StatisticTypes statisticTypeToPrint) { if (statisticTypeToPrint == StatisticTypes.Session) { conveyor.PushMessage(new OutputToMainWindowMessage("Статистика за текущую сессию:", TextColor.BrightWhite)); PrintStatistics(conveyor, _sessionStats, statisticTypeToPrint); } if (statisticTypeToPrint == StatisticTypes.Zone) { conveyor.PushMessage(new OutputToMainWindowMessage("Статистика за последнюю зону:", TextColor.BrightWhite)); PrintStatistics(conveyor, _zoneStats, statisticTypeToPrint); } if (statisticTypeToPrint == StatisticTypes.Fight) { conveyor.PushMessage(new OutputToMainWindowMessage("Статистика за последний бой:", TextColor.BrightWhite)); PrintStatistics(conveyor, _fightStats, statisticTypeToPrint); } }
public RootModel([NotNull] MessageConveyor conveyor, ProfileHolder profile, IList <RootModel> allModels) { Assert.ArgumentNotNull(conveyor, "conveyor"); _aliasList = new List <CommandAlias>(); _triggersList = new List <TriggerBase>(); _highlightList = new List <Highlight>(); _substitutionList = new List <Substitution>(); _hotkeyList = new List <Hotkey>(); _variableList = new List <Variable>(); _undoStack = new Stack <IUndo>(); _name = profile.Name; _profile = profile; _allModels = allModels; MessageConveyor = conveyor; GroupStatus = new List <CharacterStatus>(); RoomMonstersStatus = new List <MonsterStatus>(); SettingsHolder.Instance.ProfilesChanged += OnProfileChanged; }
public HotkeyUnit(MessageConveyor conveyor) : base(conveyor) { }
public override void PrintTankStatistics(MessageConveyor conveyor, StatisticTypes statisticTypeToPrint) { }
private void PrintStatistics(MessageConveyor conveyor, DamageStats stat, StatisticTypes statisticTypeToPrint) { conveyor.PushMessage(new OutputToMainWindowMessage("Ваши повреждения:", TextColor.BrightYellow)); if (stat.TotalRounds > 0) { conveyor.PushMessage(new OutputToMainWindowMessage(new[] { new TextMessageBlock(" Дамаг в раунд средний: ", TextColor.White), new TextMessageBlock((stat.TotalDamage / stat.TotalRounds).ToString("00.00"), TextColor.BrightWhite), new TextMessageBlock("\t Максимальный: ", TextColor.White), new TextMessageBlock(stat.MaxRoundDamage.ToString("00.00"), TextColor.BrightWhite), })); conveyor.PushMessage(new OutputToMainWindowMessage(new[] { new TextMessageBlock(" Дамаг cуммарный: ", TextColor.White), new TextMessageBlock(stat.TotalDamage.ToString(CultureInfo.InvariantCulture), TextColor.BrightWhite), })); } if (stat.TotalDamageMessages > 0) { conveyor.PushMessage(new OutputToMainWindowMessage(new[] { new TextMessageBlock(" Крит шанс: ", TextColor.White), new TextMessageBlock(((double)stat.TotalCritDamageMessages / stat.TotalDamageMessages).ToString("P"), TextColor.BrightWhite), })); } if (stat.TotalCasts > 0) { conveyor.PushMessage(new OutputToMainWindowMessage(new[] { new TextMessageBlock(" Шанс фейл каста: ", TextColor.White), new TextMessageBlock(((double)stat.FailedCasts / stat.TotalCasts).ToString("P"), TextColor.BrightWhite), })); } if (stat.StunRounds > 0 && stat.TotalRounds > 0) { conveyor.PushMessage(new OutputToMainWindowMessage(new[] { new TextMessageBlock(" Шанс оглушить: ", TextColor.White), new TextMessageBlock(((double)stat.StunRounds / stat.TotalRounds).ToString("P"), TextColor.BrightWhite), })); } conveyor.PushMessage(new OutputToMainWindowMessage("Умения/заклинания:", TextColor.BrightYellow)); foreach (var damageSkill in _damageSkills) { damageSkill.PrintDamageStatistics(conveyor, statisticTypeToPrint); } conveyor.PushMessage(new OutputToMainWindowMessage("Повреждения по вам:", TextColor.BrightRed)); if (stat.TotalTankRounds > 0) { conveyor.PushMessage(new OutputToMainWindowMessage(new[] { new TextMessageBlock(" Дамаг в раунд средний: ", TextColor.White), new TextMessageBlock((stat.TotalTankDamage / stat.TotalTankRounds).ToString("00.00"), TextColor.BrightWhite), new TextMessageBlock("\t Максимальный: ", TextColor.White), new TextMessageBlock(stat.MaxTankRoundDamage.ToString("00.00"), TextColor.BrightWhite), })); conveyor.PushMessage(new OutputToMainWindowMessage(new[] { new TextMessageBlock(" Дамаг cуммарный: ", TextColor.White), new TextMessageBlock(stat.TotalTankDamage.ToString(CultureInfo.InvariantCulture), TextColor.BrightWhite), })); } conveyor.PushMessage(new OutputToMainWindowMessage("Умения/заклинания:", TextColor.BrightRed)); foreach (var damageSkill in _damageSkills) { damageSkill.PrintTankStatistics(conveyor, statisticTypeToPrint); } var expMessages = new List <TextMessageBlock>(); if (stat.TotalExp > 0) { expMessages.Add(new TextMessageBlock("Опыт: ", TextColor.White)); expMessages.Add(new TextMessageBlock(stat.TotalExp.ToString(CultureInfo.InvariantCulture), TextColor.BrightWhite)); expMessages.Add(new TextMessageBlock("\t", TextColor.White)); } if (stat.TotalSlava > 0) { expMessages.Add(new TextMessageBlock("Слава: ", TextColor.White)); expMessages.Add(new TextMessageBlock(stat.TotalSlava.ToString(CultureInfo.InvariantCulture), TextColor.BrightWhite)); } if (expMessages.Any()) { conveyor.PushMessage(new OutputToMainWindowMessage(expMessages)); } }
public abstract void PrintTankStatistics(MessageConveyor conveyor, StatisticTypes statisticTypeToPrint);
public TextMessageDeserializer(MessageConveyor conveyor) : base(conveyor) { }
public CapForLineCommandUnit(MessageConveyor conveyor) : base(conveyor) { }
/// <summary> /// /// </summary> public VariableReplaceUnit(MessageConveyor conveyor) : base(conveyor) { }
public SendToWindowUnit(MessageConveyor conveyor) : base(conveyor) { }
public override void InitializeConveyor(MessageConveyor conveyor) { conveyor.AddConveyorUnit(new RoomMonstersUnit(_monstersWidgetControl, conveyor)); conveyor.AddMessageDeserializer(new RoomMonstersMessageDeserializer(conveyor)); }
public ProtocolVersionUnit(MessageConveyor conveyor) : base(conveyor) { }
public TickerUnit(MessageConveyor conveyor) : base(conveyor) { Timer = new Timer(PrintTick, null, Timeout.Infinite, Timeout.Infinite); }
public ShowMainOutputUnit(MessageConveyor conveyor) : base(conveyor) { }