public static IVisualElement CreateFromMapEntity(IMapEntity mapEntity) { if (mapEntity is RectangularBuilding) { return(new VisualRectangularBuilding((IRectangularBuildingEntity)mapEntity)); } if (mapEntity is PolygonBuilding) { return(new VisualPolygonalBuilding((IBuildingEntity)mapEntity)); } if (mapEntity is TextMarker) { return(new VisualTextMarker((ITextMarkerEntity)mapEntity)); } if (mapEntity is IWallEntity) { return(new WallElement((IWallEntity)mapEntity)); } if (mapEntity is IDoorEntity) { return(new VisualDoor((IDoorEntity)mapEntity)); } if (mapEntity is IFloorEntity) { return(new VisualFloor((IFloorEntity)mapEntity)); } return(null); }
public void AddMapEntity(IMapEntity entity) { if (entity.Position.X >= 0 && entity.Position.X < _actualWidth && entity.Position.Y >= 0 && entity.Position.Y < _actualHeight) { _mapEntities.AddValue(entity, entity.Position); } }
public BaseVisualElement(IMapEntity mapEntity) { AttachToWall = false; DisplayWhilePlacing = false; _source = mapEntity; _color = Colors.Black; CenterX = 0.5; CenterY = 0.5; }
public VisualCornerManipulator(IMapEntity mapEntity, WallElement wall, int index) : base(mapEntity) { Color = Colors.Blue; Width = Constants.ManipulatorDiameter; Height = Constants.ManipulatorDiameter; _wall = wall; _wall.PropertyChanged += manipulatedObject_PropertyChanged; _cornerIndex = index; }
public VisualCornerManipulator(IMapEntity mapEntity, VisualPolygonalBuilding polygon, int index) : base(mapEntity) { Color = Colors.Blue; Width = Constants.ManipulatorDiameter; Height = Constants.ManipulatorDiameter; _polygon = polygon; _polygon.PropertyChanged += manipulatedObject_PropertyChanged; _cornerIndex = index; }
protected internal DataBoundMapEntity(IMapEntity mapEntity) { Icon = mapEntity.Icon; DisplayText = mapEntity.DisplayText; Description = mapEntity.Description; ScoringWeight = mapEntity.ScoringWeight; Multiplicity = mapEntity.Multiplicity; DistributionWeight = mapEntity.DistributionWeight; IsMoveAllowedOnThis = mapEntity.IsMoveAllowedOnThis; }
protected virtual void CopyFillInBaseProperties(IMapEntity copy, bool copyLocation = false) { copy.Name = Name; copy.Orientation = Orientation; // copy orientation if (copyLocation) { copy.X = X; copy.Y = Y; } }
protected override void CopyFillInBaseProperties(IMapEntity copy, bool copyLocation = false) { base.CopyFillInBaseProperties(copy, copyLocation); IBuildingEntity copiedBuilding = (IBuildingEntity)copy; foreach (IFloorEntity floor in Floors) { copiedBuilding.Floors.Add((IFloorEntity)floor.Copy(copyLocation)); } }
private void MoveData(IMapEntity source) { AffectedElement.X = source.X; AffectedElement.Y = source.Y; AffectedElement.Orientation = source.Orientation; AffectedElement.Name = source.Name; if (AffectedElement is VisualTextMarker) { ((VisualTextMarker)AffectedElement).Text = ((ITextMarkerEntity)source).Text; } }
public bool Add(int layer, IMapEntity data) { List <IMapEntity> list = entities[layer]; if (list != null) { // Check if the location of new object is in use. foreach (IMapEntity entity in list) { if (entity.Position.X == data.Position.X && entity.Position.Y == data.Position.Y) { list[list.IndexOf(entity)] = data; return(true); } } list.Add(data); entities[layer] = list; NeedsImageRecreation[layer] = true; } return(false); }
public MapTeamAndEntity(IMapEntityTeam mapEntityTeam, IMapEntity mapEntity) { MapEntity = mapEntity; MapEntityTeam = mapEntityTeam; }
public bool Matches(IMapEntity mapEntity) { if (mapEntity is Object3D) { Object3D obj3d = (Object3D)mapEntity; if (obj3d.ObjectID == objectId) return true; } return false; }
private void Awake() { mapEntity = GetComponent <IMapEntity>(); }
private void InitDependencies() { mapEntity = mapEntityGO.GetComponentWithInterface <IMapEntity>(); playerDataManagerEntity = playerDataManagerEntityGO.GetComponentWithInterface <IPlayerDataManagerEntity>(); }
static void Main(string[] args) { //for (int i = 0; i < 10; i++) { // Thread thread = new Thread(ts); // thread.Start(); //} //Console.ReadKey(); //return; //DB.ConnectionStringSettingsCollection = ConfigurationManager.ConnectionStrings; string iMapConnectionDllPath = ConfigurationManager.AppSettings["IMapConnectionDllPath"]; string[] iMapConnectionDllPaths = iMapConnectionDllPath.Split(new char[] { ';' }); foreach (string path in iMapConnectionDllPaths) { Assembly assembly = Assembly.LoadFrom(path); foreach (Type type in assembly.GetExportedTypes()) { if (type.GetInterface("DBMapper.IMapConnection") != null) { IMapConnection mapper = (IMapConnection)Activator.CreateInstance(type); mapper.MapConnection(); } } } string iMapEntityDllPath = ConfigurationManager.AppSettings["IMapEntityDllPath"]; string[] iMapEntityDllPaths = iMapEntityDllPath.Split(new char[] { ';' }); foreach (string path in iMapEntityDllPaths) { Assembly assembly = Assembly.LoadFrom(path); foreach (Type type in assembly.GetExportedTypes()) { if (type.GetInterface("DBMapper.IMapEntity") != null) { IMapEntity mapper = (IMapEntity)Activator.CreateInstance(type); mapper.MapEntity(); } } } try { Map.GenerateCommands(); } catch (Exception ex) { throw; } Console.WriteLine("Mapping complete."); //servis çağrısı simule et.. Assembly businessAssembly = Assembly.LoadFrom(@"..\..\..\Business\bin\Debug\Business.dll"); foreach (Type type in businessAssembly.GetExportedTypes()) { if (type.FullName == "Business.TestBusiness") { object businessObject = Activator.CreateInstance(type); type.InvokeMember("RunTests", BindingFlags.InvokeMethod, null, businessObject, null); } } //Console.WriteLine("Tests done."); //Console.ReadKey(); }
public static void AfterMap <T>(this IMapEntity entity) { var map = Mapper.FindTypeMapFor(typeof(T), entity.GetType()); map.AfterMap(null, entity); }
public PolygonElement(IMapEntity mapEntity) : base(mapEntity) { }