Files
LuaCsForBarotraumaEP/Barotrauma/BarotraumaShared/Source/Networking/OrderChatMessage.cs
Joonas Rikkonen 044fd3344b 2f107db...5202af9
2019-03-18 21:42:26 +02:00

38 lines
1.3 KiB
C#

using System;
using System.Collections.Generic;
using System.Text;
using Lidgren.Network;
namespace Barotrauma.Networking
{
partial class OrderChatMessage : ChatMessage
{
public readonly Order Order;
//who was this order given to
public readonly Character TargetCharacter;
//which entity is this order referring to (hull, reactor, railgun controller, etc)
public readonly Entity TargetEntity;
//additional instructions (power up, fire at will, etc)
public readonly string OrderOption;
public OrderChatMessage(Order order, string orderOption, Entity targetEntity, Character targetCharacter, Character sender)
: this(order, orderOption,
order.GetChatMessage(targetCharacter?.Name, sender?.CurrentHull?.RoomName, givingOrderToSelf: targetCharacter == sender, orderOption: orderOption),
targetEntity, targetCharacter, sender)
{
}
public OrderChatMessage(Order order, string orderOption, string text, Entity targetEntity, Character targetCharacter, Character sender)
: base(sender?.Name, text, ChatMessageType.Order, sender)
{
Order = order;
OrderOption = orderOption;
TargetCharacter = targetCharacter;
TargetEntity = targetEntity;
}
}
}