public ObjectTemplateForm(MapInterface.MapInterface mapInterface) { InitializeComponent(); this.mapInterface = mapInterface; objTemplate = new MapInterface.ObjectTemplate(); updatePropertyList(); UpdateImageListView(); }
public GameMap(Graphics graphics) { this.graphics = graphics; this.scroll = new prim.Point(0, 0); mapInterface = new MapInterface.MapInterface(); controlEntity = new ControlEntity(); run = true; }
public ObjectTemplateForm(MapInterface.MapInterface mapInterface, string key) { InitializeComponent(); this.mapInterface = mapInterface; objTemplate = this.mapInterface.objectTemplates[key]; updatePropertyList(); UpdateImageListView(); this.objNameText.Text = key; }
public OpenMap(MapInterface.MapInterface mapInterface, StreamReader reader, StreamWriter writer) { this.reader = reader; this.writer = writer; this.mapInterface = mapInterface; signal = ""; maps = new List <string>(); mapDir = Directory.GetParent(Directory.GetCurrentDirectory()).FullName + "/maps"; InitializeComponent(); }
public mainForm() { mapInterface = new MapInterface.MapInterface(); client = new NamedPipeClientStream("torender"); reader = new StreamReader(client); client.Connect(); server = new NamedPipeServerStream("toui"); server.WaitForConnection(); writer = new StreamWriter(server); InitializeComponent(); }
public ControlsWindow(MapInterface.MapInterface mapInterface, StreamReader reader, StreamWriter writer) { InitializeComponent(); signal = ""; objKey = ""; this.mapInterface = mapInterface; this.buttonList = new List <Button>(); this.writer = writer; this.reader = reader; this.buttonList.Add(placeButton); this.buttonList.Add(removeButton); this.buttonList.Add(moveButton); this.buttonList.Add(detailsButton); this.buttonList.Add(shapeButton); activeButton = ""; }
public void LoadMap(Graphics graphics, string path = "") { worldAABB = new AABB(); worldAABB.LowerBound.Set(-5f, -5f); worldAABB.UpperBound.Set(5f, 5f); if (path == "") { mapInterface.Load(); } else { mapInterface = new MapInterface.MapInterface(path); } //Offload Interface float gravityValue = mapInterface.objectTemplates["Global"].properties["Gravity"].getFloat(); Vec2 gravity = new Vec2(); gravity.Set(0f, gravityValue); world = new World(worldAABB, gravity, false); world.SetContactListener(this); List <MapInterface.ObjectInstance> tempInstance = new List <MapInterface.ObjectInstance>(mapInterface.objectInstances); mapInterface.objectInstances.Clear(); //Convert to entities foreach (MapInterface.ObjectInstance curInstance in tempInstance) { prim.Point pnt = new prim.Point(curInstance.x, curInstance.y); mapInterface.objectInstances.Add(new ObjectEntity(world, curInstance.instance, graphics, pnt)); } //List<MapInterface.ObjectWall> tempWalls = new List<MapInterface.ObjectWall>(mapInterface.objectWalls); mapInterface.objectWalls.Clear(); ////Convert to wall entities //foreach (MapInterface.ObjectWall curInstance in tempInstance) //{ // prim.Point pnt = new prim.Point(curInstance.x, curInstance.y); // prim.Size size = new prim.Size(curInstance.w, curInstance.y); // mapInterface.objectWalls.Add(new WallEntity(world, curInstance.instance, graphics, pnt, size)); //} }