public void Add_test() { Text.Text text = new Text.Text(); text.Add("Sentence"); Assert.IsTrue(text.Sentences_amount() == 1); }
protected IntegerToStringStrategy(int value, int divisor, Text.Text parsedValue, IIntegerToStringStrategy nextStrategy) { _value = value; _divisor = divisor; _parsedValue = parsedValue; _nextStrategy = nextStrategy; }
public void Remove_whitespaces_test() { Text.Text text = new Text.Text(); text.Add("The test message"); text.Remove_whitespaces(); Assert.AreEqual(text.At_index(0), "The test message"); }
public void Clear_test() { Text.Text text = new Text.Text(); text.Add("Sentence"); text.Clear(); Assert.IsTrue(text.Sentences_amount() == 0); }
public void Remove_end_spaces_test() { Text.Text text = new Text.Text(); text.Add("Message "); text.Remove_end_spaces(); Assert.AreEqual(text.At_index(0), "Message"); }
public override void Initialize() { _style = Context.UiManager.StyleManager.GetStyle(this); _plainRectangle = new PlainRectangle(Context, Size, Color.White); _text = Context.TextManager.Create(_style.Font, _style.FontSize, _textValue, Size, _style.TextColor, _style.HorizontalAlignment, _style.VerticalAlignment, _style.Padding); _text.Content = _textValue; }
public void Insert_test() { Text.Text text = new Text.Text(); text.Add("Added1"); text.Add("Added2"); text.Insert("Inserted", 1); Assert.AreEqual(text.At_index(1), "Inserted"); }
public override void Initialize() { TextInputStyle style = Context.UiManager.StyleManager.GetStyle(this); _plainRectangle = new PlainRectangle(Context, Size, Color.BlanchedAlmond); _text = Context.TextManager.Create(style.Font, style.FontSize, _textValue, Size, style.TextColor, style.HorizontalAlignment, style.VerticalAlignment, style.Padding); _text.Content = _textValue; }
public MapTooltip(IContext context, GameScreen gameScreen) : base(context, "map_tooltip", new UniRectangle()) { _gameScreen = gameScreen; _rectangle = new TexturedExtensibleRectangle(context, new Vector2I(), context.TextureManager.Create("tooltip.png", "Data/UI/"), 8); LabelStyle style = Context.UiManager.StyleManager.GetStyle(this); _text = Context.TextManager.Create(style.Font, style.FontSize, "", new Vector2I(400, 600), style.TextColor, style.HorizontalAlignment, style.VerticalAlignment, style.Padding); _delay = .5f; }
public void Consonant_percentage_test() { Text.Text text = new Text.Text(); text.Add("ab"); text.Add("cu"); double consonants = text.Consonant_percentage(); Assert.AreEqual(consonants, 50); }
public void The_shortest_test() { Text.Text text = new Text.Text(); text.Add("message"); text.Add("message2"); text.Add("test"); //the shortest int result = text.The_shortest(); Assert.AreEqual(result, 4); }
public Tooltip(IContext context, string id, Control associatedControl, double delay, string text = null) : base(context, id, new UniRectangle()) { _associatedControl = associatedControl; _text = context.TextManager.Create("Courrier", 14, "", new Vector2I(400, 500), Color.Wheat, HorizontalAlignment.Left, VerticalAlignment.Top, new Padding(8)); if(text != null) _text.Content = text; Texture texture = Context.TextureManager.Create("tooltip.png", @"Data/UI/"); _rectangle = new TexturedExtensibleRectangle(Context, new Vector2I(), texture, 8); _delay = delay; Visible = false; }
public Tooltip(IContext context, string id, Control associatedControl, double delay, string text = null) : base(context, id, new UniRectangle()) { _associatedControl = associatedControl; _text = context.TextManager.Create("Courrier", 14, "", new Vector2I(400, 500), Color.Wheat, HorizontalAlignment.Left, VerticalAlignment.Top, new Padding(8)); if (text != null) { _text.Content = text; } Texture texture = Context.TextureManager.Create("tooltip.png", @"Data/UI/"); _rectangle = new TexturedExtensibleRectangle(Context, new Vector2I(), texture, 8); _delay = delay; Visible = false; }
static void Main(string[] args) { Text.Text text = new Text.Text(); text.Add(" sentence "); text.Add("we are here"); text.Show(); text.Remove_end_spaces(); text.Remove_begin_spaces(); text.Remove_whitespaces(); Console.WriteLine("- - - - - - - - - -"); text.Show(); Console.ReadKey(); }
private StringStrategy(Text.Text text) => _text = text;
public FleetRenderingInfo(IContext context, Fleet fleet, Vector2I size) { WorldPosition = (Vector3)fleet.Location.Center; WorldMatrix = Matrix.RotationY(-(float) (Math.PI/2))*Matrix.Translation(WorldPosition); ShipCount = fleet.ShipCount; Fleets = new List<Fleet> { fleet }; if(fleet.Owner.Equals(context.Realm)) CurrentStatus = Status.Mine; else CurrentStatus = new List<Status> {Status.Ally, Status.Enemy, Status.Neutral}.RandomItem(); Text = context.TextManager.Create("Courrier", 14, RandomGenerator.Get(1,2000).ToString(CultureInfo.InvariantCulture), new Vector2I(size.X-8, size.Y), Color.Wheat, HorizontalAlignment.Center, VerticalAlignment.Middle, new Padding(2)); }
public override void Initialize() { _style = Context.UiManager.StyleManager.GetStyle(this); _text = Context.TextManager.Create(_style.Font, _style.FontSize, _textValue, Size, _style.TextColor, _style.HorizontalAlignment, _style.VerticalAlignment, _style.Padding); }