public MarkerItemModel(GameMarker m, IdeCollection <IdeBaseItem> source) : base(source) { _marker = m; Asset = new AssetController(AssetType.Image); Asset.Register(m.Source); Asset.PropertyChanged += AssetUpdated; }
public MarkerItemModel(MarkerItemModel m, IdeCollection <IdeBaseItem> source) : base(source) { _marker = new GameMarker { Source = m.Asset.FullPath, Id = Guid.NewGuid().ToString() //TODO: Proper ID generation, not as a GUID }; Name = m.Name; }
public MarkerItemModel(IdeCollection <IdeBaseItem> source) : base(source) { _marker = new GameMarker { Id = Guid.NewGuid().ToString(), //TODO: Proper ID generation, not as a GUID Source = AssetManager.Instance.Assets.FirstOrDefault(x => x.Type == AssetType.Image)?.FullPath, }; Name = "New Marker"; RaisePropertyChanged("Asset"); }
public MarkerItemModel(MarkerItemModel m, IdeCollection <IdeBaseItem> source) : base(source) { _marker = new GameMarker { Id = Guid.NewGuid().ToString() //TODO: Proper ID generation, not as a GUID }; Asset = new AssetController(AssetType.Image); Asset.Register(m._marker.Source); _marker.Source = Asset.FullPath; Asset.PropertyChanged += AssetUpdated; Name = m.Name; }
public MarkerItemModel(IdeCollection <IdeBaseItem> source) : base(source) { _marker = new GameMarker { Id = Guid.NewGuid().ToString(), //TODO: Proper ID generation, not as a GUID }; Asset = new AssetController(AssetType.Image); _marker.Source = Asset.FullPath; Asset.PropertyChanged += AssetUpdated; Name = "New Marker"; RaisePropertyChanged("Asset"); }
//public Dictionary<Tuple<string,string>,int> MarkersDict //{ // get // { // Dictionary<Tuple<string, string>, int> markertuple = new Dictionary<Tuple<string,string>,int>(); // if (_markers.Count > 0) // { // foreach (Marker m in _markers) // { // Tuple<string, string> key = Tuple.Create<string, string>(m.Model.Name, m.Model.Id.ToString()); // markertuple.Add(key, m.Count); // } // } // return markertuple; // } //} internal void AddMarker(GameMarker model, ushort count) { Marker marker = _markers.FirstOrDefault(m => m.Model.Equals(model)); if (marker != null) { marker.SetCount((ushort)(marker.Count + count)); } else if (count > 0) { _markers.Add(new Marker(this, model, count)); } }
internal void SetMarker(Player player, string lId, string name, int count, bool notify = true) { int oldCount = 0; Marker marker = FindMarker(lId, name); if (marker != null) { oldCount = marker.Count; marker.SetCount((ushort)count); } else if (count > 0) { GameMarker model = Program.GameEngine.GetMarkerModel(lId); model.Name = name; AddMarker(model, (ushort)count); } }
internal void AddRecentMarker(GameMarker marker) { int idx = _recentMarkers.IndexOf(marker); if (idx == 0) { return; } if (idx > 0) { _recentMarkers.RemoveAt(idx); _recentMarkers.Insert(0, marker); return; } if (_recentMarkers.Count == MaxRecentMarkers) { _recentMarkers.RemoveAt(MaxRecentMarkers - 1); } _recentMarkers.Insert(0, marker); }
public void MarkerSetCount(int cardId, int count, string markerName, string markerId) { if (count < 0) { count = 0; } Card card = Card.Find(cardId); Marker marker = card.FindMarker(markerId, markerName); int origCount = 0; /*if (card.Controller != Player.LocalPlayer) * Program.GameMess.Warning(String.Format("{0} Can't set markers on {1} because they don't control it.", Player.LocalPlayer.Name, card.Name)); */ // Will add in checks or controls to handle/allow this. -- DS QueueAction(() => { if (marker == null) { GameMarker model = Program.GameEngine.GetMarkerModel(markerId); model.Name = markerName; Program.Client.Rpc.AddMarkerReq(card, markerId, markerName, (ushort)count, (ushort)origCount, true); card.AddMarker(model, (ushort)count); } else { origCount = marker.Count; if (origCount < count) { Program.Client.Rpc.AddMarkerReq(card, markerId, markerName, (ushort)(count - origCount), (ushort)origCount, true); card.AddMarker(marker.Model, (ushort)(count - origCount)); } else if (origCount > count) { Program.Client.Rpc.RemoveMarkerReq(card, markerId, markerName, (ushort)(origCount - count), (ushort)origCount, true); card.RemoveMarker(marker, (ushort)(origCount - count)); } } }); }
internal void AddMarker(GameMarker model) { AddMarker(model, 1); }
public MarkerItemModel(GameMarker m, IdeCollection <IdeBaseItem> source) : base(source) { _marker = m; }
public Marker(Card card, GameMarker model, ushort count) : this(card, model) { _count = count; }
public Marker(Card card, GameMarker model) { _card = card; _model = model; }