private void TextCommand(SceneTextCommandInfo command) { var obj = new HandlerText(command, Entities); obj.Start(); var name = command.Name ?? Guid.NewGuid().ToString(); if (!objects.ContainsKey(name)) { objects.Add(name, obj); } }
public HandlerText(SceneTextCommandInfo info, IEntityPool entityPool) { this.Content = info.Content ?? String.Empty; this.speed = info.Speed ?? 0; this.position = new MegaMan.Common.Geometry.Point(info.X, info.Y); this.entityPool = entityPool; this.font = info.Font ?? "Default"; if (info.Binding != null) { this.binding = Binding.Create(info.Binding, this); } }
public static SceneTextCommandInfo LoadTextCommand(XElement node) { var info = new SceneTextCommandInfo(); info.Content = node.TryAttribute <string>("content"); info.Name = node.TryAttribute <string>("name"); info.Speed = node.TryAttribute <int>("speed"); info.X = node.GetAttribute <int>("x"); info.Y = node.GetAttribute <int>("y"); var bindingNode = node.Element("Binding"); if (bindingNode != null) { info.Binding = LoadSceneBinding(bindingNode); } info.Font = node.TryAttribute <string>("font"); return(info); }