コード例 #1
0
ファイル: MapObject.cs プロジェクト: LywOPUS/D001_Minesweeper
 public MapObject(Grid2D <MapObject> grid2D, int x, int y)
 {
     _grid2D = grid2D;
     this.x  = x;
     this.y  = y;
     _type   = MapObjectType.Empty;
 }
コード例 #2
0
        private TextBlock CreateTextBlock(MapObjectType mapObjectType)
        {
            TextBlock textblock = new TextBlock();

            textblock.Text = mapObjectType.ToString();
            return(textblock);
        }
コード例 #3
0
        public static string get()
        {
            MapObjectType type = MapObjectType.Forester;

            type = MapObjectType.Tree | MapObjectType.Warehouse;
            return(type.ToString());
        }
コード例 #4
0
ファイル: MapObjectFactory.cs プロジェクト: Uhha/Fo2
    public static MapObject GetMapObject(int start, MapObjectType objType, byte[] bytes, Hex[] hexes, out int newStart)
        {
            switch (objType)
            {
                //case MapObjectType.Item:
                //    break;
                case MapObjectType.Critter:
                    return new Critter(start, bytes, hexes, criNames, itemsProtoNames, out newStart);
                case MapObjectType.Scenery:
                    return new Scenery(start, bytes, hexes, sceNames, itemsProtoNames, out newStart);
                case MapObjectType.Wall:
                    return new Wall(start, bytes, hexes, wallNames, itemsProtoNames, out newStart);
                //case MapObjectType.Tiles:
                //    break;
                case MapObjectType.Misc:
                    return new Misc(start, bytes, hexes, miscNames, itemsProtoNames, out newStart);
                //case MapObjectType.Interface:
                //    break;
                //case MapObjectType.Invent:
                //    break;
                //case MapObjectType.Head:
                //    break;
                //case MapObjectType.Backgrnd:
                //    break;
                //case MapObjectType.Skilldex:
                //    break;
                //default:
                //    break;
            }
            newStart = start + 88;
            return null;

        }
コード例 #5
0
 public MapObjectProperties(int elevation, MapObjectType mapObjectType, bool isSinglePiece, int possibleInTileShift)
 {
     this.possibleInTileShift = possibleInTileShift;
     this.isSinglePiece       = isSinglePiece;
     this.elevation           = elevation;
     this.mapObjectType       = mapObjectType;
 }
コード例 #6
0
ファイル: MOBFile.cs プロジェクト: LoL-Sabre/MOBEditor
 public MOBObject(BinaryReader br)
 {
     MOBObjectName     = Encoding.ASCII.GetString(br.ReadBytes(60));
     MOBObjectNameChar = GetCharsFromString(MOBObjectName, 60);
     MOBObjectName     = GetStringFromChars(MOBObjectNameChar);
     ObjectZero1       = br.ReadUInt16();
     ObjectFlag        = (MapObjectType)br.ReadByte();
     ObjectZero2       = br.ReadByte();
     for (int i = 0; i < 3; i++)
     {
         Position[i] = br.ReadSingle();
     }
     for (int i = 0; i < 3; i++)
     {
         Rotation[i] = br.ReadSingle();
     }
     for (int i = 0; i < 3; i++)
     {
         Scale[i] = br.ReadSingle();
     }
     for (int i = 0; i < 3; i++)
     {
         HealthBarPosition1[i] = br.ReadSingle();
     }
     for (int i = 0; i < 3; i++)
     {
         HealthBarPosition2[i] = br.ReadSingle();
     }
     ObjectZero3 = br.ReadUInt32();
 }
コード例 #7
0
 public Monster(List<Image.ImageUnit> frames, MapObjectType type)
     : base(frames, type)
 {
     switch (type)
     {
         case MapObjectType.GreenSlime:
             SetStatus(30, 20, 5, 1, 1, 1, new List<MonsterFeature> { MonsterFeature.None });
             break;
         case MapObjectType.BlueSlime:
             SetStatus(50, 25, 5, 2, 1, 1, new List<MonsterFeature> { MonsterFeature.None });
             break;
         case MapObjectType.RedSlime:
             SetStatus(80, 30, 5, 3, 2, 1, new List<MonsterFeature> { MonsterFeature.None });
             break;
         case MapObjectType.LittleBat:
             SetStatus(40, 35, 20, 5, 2, 1, new List<MonsterFeature> { MonsterFeature.None });
             break;
         case MapObjectType.BigBat:
             SetStatus(70, 80, 30, 7, 4, 2, new List<MonsterFeature> { MonsterFeature.TwiceAttack });
             break;
         case MapObjectType.Wizard:
             SetStatus(70, 15, 10, 4, 2, 1, new List<MonsterFeature> { MonsterFeature.Penetrate });
             break;
         case MapObjectType.YellowWizard:
             SetStatus(150, 25, 25, 10, 3, 1, new List<MonsterFeature> { MonsterFeature.Penetrate });
             break;
         case MapObjectType.Skeleton:
             SetStatus(200, 100, 5, 7, 3, 1, new List<MonsterFeature> { MonsterFeature.None });
             break;
     }
 }
コード例 #8
0
 public IList <MapObject> GetAllMapObjects(MapObjectType mapObjectType)
 {
     using (var repositoriesContainer = new InnostarRepositoriesContainer())
     {
         return(repositoriesContainer.MapObjectsRepository.GetAllMapObjects(mapObjectType));
     }
 }
コード例 #9
0
        public ObjectContent(XmlNode node)
        {
            if (node.Attributes[AttributeNames.MapObjectAttributes.Name] != null)
                Name = node.Attributes[AttributeNames.MapObjectAttributes.Name].Value;

            if (node.Attributes[AttributeNames.MapObjectAttributes.Type] != null)
                Type = node.Attributes[AttributeNames.MapObjectAttributes.Type].Value;

            if (node[AttributeNames.MapObjectAttributes.Properties] != null)
                properties = new PropertyCollection(node[AttributeNames.MapObjectAttributes.Properties]);

            int x = 0, y = 0, width = 0, height = 0;

            if (node.Attributes[AttributeNames.MapObjectAttributes.X] != null)
                x = Utilities.TryToParseInt(node.Attributes[AttributeNames.MapObjectAttributes.X].Value);

            if (node.Attributes[AttributeNames.MapObjectAttributes.Y] != null)
                y = Utilities.TryToParseInt(node.Attributes[AttributeNames.MapObjectAttributes.Y].Value);

            if (node.Attributes[AttributeNames.MapObjectAttributes.Width] != null)
                width = Utilities.TryToParseInt(node.Attributes[AttributeNames.MapObjectAttributes.Width].Value);

            if (node.Attributes[AttributeNames.MapObjectAttributes.Height] != null)
                height = Utilities.TryToParseInt(node.Attributes[AttributeNames.MapObjectAttributes.Height].Value);

            Bounds = new Rectangle(x, y, width, height);

            string objectPoints = String.Empty;

            if (node.Attributes[AttributeNames.MapObjectAttributes.GID] != null)
            {
                objectType = MapObjectType.Tile;
                GID = Utilities.TryToParseInt(node.Attributes[AttributeNames.MapObjectAttributes.GID].Value);
            }
            else if (node.Attributes[AttributeNames.MapObjectAttributes.Polygon] != null)
            {
                objectType = MapObjectType.Polygon;
                objectPoints = node.Attributes[AttributeNames.MapObjectAttributes.Polygon].Value;
            }
            else if (node.Attributes[AttributeNames.MapObjectAttributes.Polyline] != null)
            {
                objectType = MapObjectType.Polyline;
                objectPoints = node.Attributes[AttributeNames.MapObjectAttributes.Polyline].Value;
            }

            if(!String.IsNullOrEmpty(objectPoints))
            {
                string[] splitPoints = objectPoints.Split(' ');
                foreach(string splitPoint in splitPoints)
                {
                    string[] coordinates = splitPoint.Split(',');

                    float coordinateX = 0f, coordinateY = 0f;
                    float.TryParse(coordinates[0], NumberStyles.None, CultureInfo.InvariantCulture, out coordinateX);
                    float.TryParse(coordinates[1], NumberStyles.None, CultureInfo.InvariantCulture, out coordinateY);

                    points.Add(new Point((int)x, (int)y));
                }
            }
        }
コード例 #10
0
 public byte[] GetMapObjectImage(MapObjectType mapObjectType, int id)
 {
     using (var repositoriesContainer = new InnostarRepositoriesContainer())
     {
         return(repositoriesContainer.MapObjectsRepository.GetMapObjectImage(mapObjectType, id));
     }
 }
コード例 #11
0
 public MapObject(List <Point> points, MapObjectType type)
 {
     Points      = points;
     Type        = type;
     Middlepoint = new Point((int)Math.Round(points.Sum(x => (double)x.X) / points.Count),
                             (int)Math.Round(points.Sum(y => (double)y.Y) / points.Count));
 }
コード例 #12
0
 public MapObject(string name, Rectangle bounds, Orientation orientation, MapObjectType type, PropertyCollection properties)
 {
     Name        = name;
     Type        = type;
     Bounds      = bounds;
     Orientation = orientation;
     Properties  = properties;
 }
コード例 #13
0
 private bool IsNoNameObject(MapObjectType mop)
 {
     return(mop.Equals(MapObjectType.Parking) ||
            mop.Equals(MapObjectType.ParkingSlot) ||
            mop.Equals(MapObjectType.Road) ||
            mop.Equals(MapObjectType.WaitingRoom) ||
            mop.Equals(MapObjectType.Building));
 }
コード例 #14
0
        private MapObject CreateEditedObject()
        {
            MapObjectType type         = SettingTypeOfEditedMapObject();
            MapObject     objectToEdit = SettingMapObject(type);

            _mapObjectController.UpdateMapObject(objectToEdit);
            return(objectToEdit);
        }
コード例 #15
0
ファイル: Presenter.cs プロジェクト: pev285/BulderExercise
 private void OnBuildingBlockChoose(MapObjectType type)
 {
     buildingCursor.SetCursorOff();
     if (type != MapObjectType.AIR)
     {
         buildingCursor.SetCursorOn(type, mapdata);
     }
 }
コード例 #16
0
        private void InsertTextToCell(MapObjectType mapObjectType, Grid cell)
        {
            TextBlock textblock = CreateTextBlock(mapObjectType);

            textblock.SetValue(Grid.ColumnProperty, 1);
            textblock.VerticalAlignment = VerticalAlignment.Center;
            cell.Children.Add(textblock);
        }
コード例 #17
0
        public void SetObjectTypeAt(Vector3Int position, MapObjectType type)
        {
            int x = Mathf.Clamp(position.x, 0, xSize - 1);
            int y = Mathf.Clamp(position.y, 0, ySize - 1);
            int z = Mathf.Clamp(position.z, 0, zSize - 1);

            map[x, y, z] = type;
        }
コード例 #18
0
        private void InsertRectangleToCell(MapObjectType mapObjectType, Grid cell)
        {
            Rectangle rectangle = CreateRectangle(mapObjectType);

            rectangle.SetValue(Grid.ColumnProperty, 0);
            rectangle.VerticalAlignment = VerticalAlignment.Center;
            cell.Children.Add(rectangle);
        }
コード例 #19
0
        public MapObjectContent(XmlNode node, ContentImporterContext context)
        {
            // get the object's name and type
            if (node.Attributes["name"] != null)
                Name = node.Attributes["name"].Value;
            if (node.Attributes["type"] != null)
                Type = node.Attributes["type"].Value;

            // read the object properties
            if (node["properties"] != null)
                Properties = new PropertyCollection(node["properties"], context);

            // parse out the bounds of the object. values default to 0 if the attribute is missing from the node.
            int x = node.Attributes["x"] != null ? int.Parse(node.Attributes["x"].Value, CultureInfo.InvariantCulture) : 0;
            int y = node.Attributes["y"] != null ? int.Parse(node.Attributes["y"].Value, CultureInfo.InvariantCulture) : 0;
            int width = node.Attributes["width"] != null ? int.Parse(node.Attributes["width"].Value, CultureInfo.InvariantCulture) : 0;
            int height = node.Attributes["height"] != null ? int.Parse(node.Attributes["height"].Value, CultureInfo.InvariantCulture) : 0;
            Bounds = new Rectangle(x, y, width, height);

            // stores a string of points to parse out if this object is a polygon or polyline
            string pointsAsString = null;

            // if there's a GID, it's a tile object
            if (node.Attributes["gid"] != null)
            {
                ObjectType = MapObjectType.Tile;
                GID = int.Parse(node.Attributes["gid"].Value, CultureInfo.InvariantCulture);
            }
            // if there's a polygon node, it's a polygon object
            else if (node["polygon"] != null)
            {
                ObjectType = MapObjectType.Polygon;
                pointsAsString = node["polygon"].Attributes["points"].Value;
            }
            // if there's a polyline node, it's a polyline object
            else if (node["polyline"] != null)
            {
                ObjectType = MapObjectType.Polyline;
                pointsAsString = node["polyline"].Attributes["points"].Value;
            }

            // if we have some points to parse, we do that now
            if (pointsAsString != null)
            {
                // points are separated first by spaces
                string[] pointPairs = pointsAsString.Split(' ');
                foreach (string p in pointPairs)
                {
                    // then we split on commas
                    string[] coords = p.Split(',');

                    // then we parse the X/Y coordinates
                    Points.Add(new Vector2(
                        float.Parse(coords[0], CultureInfo.InvariantCulture),
                        float.Parse(coords[1], CultureInfo.InvariantCulture)));
                }
            }
        }
コード例 #20
0
        private Rectangle CreateRectangle(MapObjectType mapObjectType)
        {
            Rectangle rectangle = new Rectangle();

            rectangle.Fill   = MapObjectColors.getInstance().getColor(mapObjectType);
            rectangle.Width  = 25;
            rectangle.Height = 25;
            return(rectangle);
        }
コード例 #21
0
ファイル: MapObjectBase.cs プロジェクト: GodLesZ/ZeusEngine
        protected MapObjectBase(Format rsw, MapObjectType type)
        {
            _parentRsw = rsw;
            Type       = type;

            // Defaults
            Name     = string.Empty;
            Position = Vector3.Zero;
        }
コード例 #22
0
        private MapObject SettingMapObject(MapObjectType type)
        {
            MapObject objectToEdit = SelectedMapObject;

            DisplayMapObject.MapObjectType = type;
            objectToEdit.MapObjectEntity   = DisplayMapObject;
            objectToEdit.Rectangle.Fill    = type.ObjectTypeColor;
            return(objectToEdit);
        }
コード例 #23
0
ファイル: MapObjectBase.cs プロジェクト: GodLesZ/ZeusEngine
        protected MapObjectBase(Format rsw, MapObjectType type)
        {
            _parentRsw = rsw;
            Type = type;

            // Defaults
            Name = string.Empty;
            Position = Vector3.Zero;
        }
コード例 #24
0
        private void InsertValueToCell(MapObjectType mapObjectType, int row, int column)
        {
            Grid cell = CreateLegendCell(row, column);

            InsertRectangleToCell(mapObjectType, cell);
            InsertTextToCell(mapObjectType, cell);

            Legend.Children.Add(cell);
        }
コード例 #25
0
 public MapObject(String name, int Id, MapObjectMetrics MapObjectMetrics, MapObjectType MapObjectType, MapObjectDoor MapObjectDoor, MapObjectDescription MapObjectDescription)
 {
     this.Name                 = name;
     this.Id                   = Id;
     this.MapObjectMetrics     = MapObjectMetrics;
     this.MapObjectType        = MapObjectType;
     this.MapObjectDoor        = MapObjectDoor;
     this.MapObjectDescription = MapObjectDescription;
     setMapObjectProperties(MapObjectMetrics);
 }
コード例 #26
0
 public void SetCursorOn(MapObjectType type, MapData mapData)
 {
     this.currentCursorType = type;
     cursorDescription      = objectsMapper.GetDescriptionByType(type);
     positiveCursor         = cursorDescription.PositiveCursor;
     positiveRotator        = positiveCursor.GetComponent <BuildingBlockRotator>();
     negativeCursor         = cursorDescription.NegativeCursor;
     negativeRotator        = negativeCursor.GetComponent <BuildingBlockRotator>();
     this.mapData           = mapData;
     isCursorOn             = true;
 }
コード例 #27
0
 private int GetIndexByType(MapObjectType type)
 {
     for (int i = 0; i < objectsMapper.Count; i++)
     {
         if (objectsMapper[i].type == type)
         {
             return(i);
         }
     }
     return(-1);
 }
コード例 #28
0
    public static GameObject CreateMapObject(MapObjectType type)
    {
        GameObject obj = Instantiate(MapMakerController.Instance.MapObjectsPrefabs[(int)type], MapMakerController.Instance.Map.transform);

        Destroy(obj.GetComponent <Collider2D>());
        obj.AddComponent <MapObjectController>().Type = type;
        BoxCollider2D c = obj.AddComponent <BoxCollider2D>();

        c.isTrigger = true;

        return(obj);
    }
コード例 #29
0
        public List <MapObject> SearchMapObjects(MapObjectType searchedMapObjectType)
        {
            List <MapObject> searchResultMapObjects = new List <MapObject>();

            foreach (MapObject mapObject in MainWindow._allMapObjects)
            {
                if (mapObject.MapObjectEntity.MapObjectType.TypeOfMapObject == searchedMapObjectType.TypeOfMapObject)
                {
                    searchResultMapObjects.Add(mapObject);
                }
            }
            return(searchResultMapObjects);
        }
コード例 #30
0
        public IList <MapObject> GetRelatedMapObjects(int id, MapObjectType parentMapObjectType, MapObjectType filterType)
        {
            using (var repositoriesContainer = new InnostarRepositoriesContainer())
            {
                var parentMapObject = new MapObject
                {
                    Id            = id,
                    MapObjectType = parentMapObjectType
                };

                return(repositoriesContainer.MapObjectsRepository.GetRelatedMapObjects(parentMapObject, filterType));
            }
        }
コード例 #31
0
ファイル: Map.cs プロジェクト: fyang93/Destiny
        public int AssignObjectID(MapObjectType type)
        {
            switch (type)
            {
            case MapObjectType.Npc: return(++mNpcObjectIDs);

            case MapObjectType.Mob: return(++mMobObjectIDs);

            case MapObjectType.Reactor: return(++mReactorObjectIDs);

            default: throw new ArgumentException(type.ToString());
            }
        }
コード例 #32
0
    public GameObject Instantiate(MapObjectType objectType, int sortingOrder)
    {
        string objType = objectType.ToString().Replace("_", "");
        objType = objType.ToLower();

        GameObject prefab = PrefabUtils.GetPrefab(this, objType);

        GameObject go = Instantiate(prefab) as GameObject;

        go.GetComponent<SpriteRenderer>().sortingOrder = sortingOrder;

        return go;
    }
コード例 #33
0
 private void SearchMapObjectsButton_Click(object sender, RoutedEventArgs e)
 {
     if (SearchObjectTypeComboBox.SelectedItem != null)
     {
         MapObjectType    searchedMapObjectType  = (MapObjectType)SearchObjectTypeComboBox.SelectedItem;
         List <MapObject> searchResultMapObjects = _mapObjectController.SearchMapObjects(searchedMapObjectType);
         ObjectSearchResultsDataGrid.ItemsSource = searchResultMapObjects;
     }
     else
     {
         return;
     }
 }
コード例 #34
0
        /// <summary>
        ///     Объекты в указанной зоне
        /// </summary>
        /// <param name="objType">Какие объекты выбирать</param>
        /// <returns></returns>
        public MapObject[] Select(MapObjectType objTypes)
        {
            List <MapObject> objs = new List <MapObject>();

            foreach (MapObject mo in _objects)
            {
                if ((objTypes & mo.ObjectType) != 0)
                {
                    objs.Add(mo);
                }
            }
            ;
            return(objs.ToArray());
        }
コード例 #35
0
        public bool CanBeBuildNearMe(MapObjectType type, out BuildCondition.RelativePosition position)
        {
            int count = canBeBuiltNearMe.Count;

            for (int i = 0; i < count; i++)
            {
                if (canBeBuiltNearMe[i].type == type)
                {
                    position = canBeBuiltNearMe[i].position;
                    return(true);
                }
            }

            position = BuildCondition.RelativePosition.ON_THE_SIDE;
            return(false);
        }
コード例 #36
0
ファイル: MapObject.cs プロジェクト: Sharparam/DiseasedToast
        public MapObject(string name, string type, MapObjectType objectType, Rectangle bounds, int gid, IEnumerable<Vector2> points, IEnumerable<KeyValuePair<string, string>> properties)
        {
            Name = name;
            Type = type;
            ObjectType = objectType;
            Bounds = new Rectangle(bounds.X, bounds.Y, bounds.Width, bounds.Height);
            GID = gid;

            Points = new List<Vector2>();
            foreach (var point in points)
                Points.Add(new Vector2(point.X, point.Y));

            Properties = new Dictionary<string, string>();
            foreach (var property in properties)
                Properties.Add(property.Key, property.Value);
        }
コード例 #37
0
ファイル: GenericMapObject.cs プロジェクト: Uhha/Fo2
        public GenericMapObject(string name, MapObjectType objType, int HexInt)
        {
            TextureName = name;
            HexPosition = HexInt;
            switch (objType)
            {
                case MapObjectType.Item:
                    break;
                case MapObjectType.Critter:
                    _prefix = "/art/critters/";
                    break;
                case MapObjectType.Scenery:
                    break;
                case MapObjectType.Wall:
                    break;
                case MapObjectType.Tile:
                    break;
                case MapObjectType.Misc:
                    break;
                case MapObjectType.Interface:
                    break;
                case MapObjectType.Invent:
                    break;
                case MapObjectType.Head:
                    break;
                case MapObjectType.Backgrnd:
                    break;
                case MapObjectType.Skilldex:
                    break;
                default:
                    break;
            }

            MapObjectType = objType;
            _texture = new FRM(_repo + _prefix + TextureName + "AA.frm", MovementHelper.HexX(HexInt), MovementHelper.HexY(HexInt));
        }
コード例 #38
0
ファイル: MapObject.cs プロジェクト: mifumi323/funya3
 public MapObject(MapObjectType objectType, Map parent)
 {
     ObjectType = objectType;
     Parent = parent;
     X = Y = 0;
 }
コード例 #39
0
 public MapObject(ImageUnit img, MapObjectType type)
     : this(new List<ImageUnit>() { img }, type)
 {
 }
コード例 #40
0
ファイル: Floor.cs プロジェクト: Sharknevercries/Tower-in-NCU
 public void SetMapObject(int row, int col, MapObjectType type) => _map[row, col] = MapObjectFactory.CreateMapObject(type);
コード例 #41
0
        public static MapObject CreateMapObject(MapObjectType type)
        {
            switch (type)
            {
                // Item Zone
                case MapObjectType.Floor1:
                    return new Item(_dataSet[(int)MapObjectImage.Floor1], type);
                case MapObjectType.Block1:
                    return new Item(_dataSet[(int)MapObjectImage.Block1], type);
                case MapObjectType.UpStair1:
                    return new Item(_dataSet[(int)MapObjectImage.UpStair1], type);
                case MapObjectType.UpStair2:
                    return new Item(_dataSet[(int)MapObjectImage.UpStair2], type);
                case MapObjectType.YellowKey:
                    return new Item(_dataSet[(int)MapObjectImage.YellowKey], type);
                case MapObjectType.BlueKey:
                    return new Item(_dataSet[(int)MapObjectImage.BlueKey], type);
                case MapObjectType.RedKey:
                    return new Item(_dataSet[(int)MapObjectImage.RedKey], type);
                case MapObjectType.MonsterBook:
                    return null;
                case MapObjectType.DownStair1:
                    return new Item(_dataSet[(int)MapObjectImage.DownStair1], type);
                case MapObjectType.DownStair2:
                    return new Item(_dataSet[(int)MapObjectImage.DownStair2], type);
                case MapObjectType.RedPotion:
                    return new Item(_dataSet[(int)MapObjectImage.RedPotion], type);
                case MapObjectType.BluePotion:
                    return new Item(_dataSet[(int)MapObjectImage.BluePotion], type);
                case MapObjectType.RedCrystal:
                    return new Item(_dataSet[(int)MapObjectImage.RedCrystal], type);
                case MapObjectType.BlueCrystal:
                    return new Item(_dataSet[(int)MapObjectImage.BlueCrystal], type);

                case MapObjectType.YellowDoor:
                    return new Item(_dataSet[(int)MapObjectImage.YellowDoor], type);
                case MapObjectType.BlueDoor:
                    return new Item(_dataSet[(int)MapObjectImage.BlueDoor], type);
                case MapObjectType.RedDoor:
                    return new Item(_dataSet[(int)MapObjectImage.RedDoor], type);
                case MapObjectType.TeleportStaf:
                    return new Item(_dataSet[(int)MapObjectImage.TeleportStaf], type);

                case MapObjectType.Sword1:
                    return new Item(_dataSet[(int)MapObjectImage.Sword1], type);
                case MapObjectType.Sword2:
                    return new Item(_dataSet[(int)MapObjectImage.Sword2], type);
                case MapObjectType.Sword3:
                    return new Item(_dataSet[(int)MapObjectImage.Sword3], type);
                case MapObjectType.Sword4:
                    return new Item(_dataSet[(int)MapObjectImage.Sword4], type);
                case MapObjectType.Sword5:
                    return new Item(_dataSet[(int)MapObjectImage.Sword5], type);
                case MapObjectType.Shield1:
                    return new Item(_dataSet[(int)MapObjectImage.Shield1], type);
                case MapObjectType.Shield2:
                    return new Item(_dataSet[(int)MapObjectImage.Shield2], type);
                case MapObjectType.Shield3:
                    return new Item(_dataSet[(int)MapObjectImage.Shield3], type);
                case MapObjectType.Shield4:
                    return new Item(_dataSet[(int)MapObjectImage.Shield4], type);
                case MapObjectType.Shield5:
                    return new Item(_dataSet[(int)MapObjectImage.Shield5], type);

                // Shop Zone
                case MapObjectType.GoldShop:
                    return new Shop(_dataSet[(int)MapObjectImage.Shop], type);
                case MapObjectType.ShopBody1:
                    return new Shop(_dataSet[(int)MapObjectImage.ShopBody1], type);
                case MapObjectType.ShopBody2:
                    return new Shop(_dataSet[(int)MapObjectImage.ShopBody2], type);
                case MapObjectType.ExpShop:
                    return new Shop(_dataSet[(int)MapObjectImage.NPC1], type);

                // Monster Zone
                case MapObjectType.GreenSlime:
                    return new Monster(_dataSet[(int)MapObjectImage.GreenSlime], type);
                case MapObjectType.BlueSlime:
                    return new Monster(_dataSet[(int)MapObjectImage.BlueSlime], type);
                case MapObjectType.RedSlime:
                    return new Monster(_dataSet[(int)MapObjectImage.RedSlime], type);
                case MapObjectType.LittleBat:
                    return new Monster(_dataSet[(int)MapObjectImage.LittleBat], type);
                case MapObjectType.BigBat:
                    return new Monster(_dataSet[(int)MapObjectImage.BigBat], type);
                case MapObjectType.RedBat:
                    return new Monster(_dataSet[(int)MapObjectImage.RedBat], type);
                case MapObjectType.Wizard:
                    return new Monster(_dataSet[(int)MapObjectImage.Wizard], type);
                case MapObjectType.YellowWizard:
                    return new Monster(_dataSet[(int)MapObjectImage.YellowWizard], type);
                case MapObjectType.RedWizard:
                    return new Monster(_dataSet[(int)MapObjectImage.RedWizard], type);
                case MapObjectType.Skeleton:
                    return new Monster(_dataSet[(int)MapObjectImage.Skeleton], type);
                case MapObjectType.ShieldSkeleton:
                    return new Monster(_dataSet[(int)MapObjectImage.ShieldSkeleton], type);
                case MapObjectType.EliteSkeleton:
                    return new Monster(_dataSet[(int)MapObjectImage.EliteSkeleton], type);

            }
            throw new Exception("Not expected MapObject type " + (int)type + ".");
        }
コード例 #42
0
ファイル: Item.cs プロジェクト: Sharknevercries/Tower-in-NCU
 public Item(List<ImageUnit> frames, MapObjectType type)
     : base(frames, type)
 {
 }
コード例 #43
0
ファイル: Item.cs プロジェクト: Sharknevercries/Tower-in-NCU
 public Item(ImageUnit img, MapObjectType type)
     : base(img, type)
 {
 }
コード例 #44
0
ファイル: MapPainter.cs プロジェクト: donblas/magecrawl
 // If you change this, update HelpPainter.cs
 private static char ConvertMapObjectToChar(MapObjectType t)
 {
     switch (t)
     {
         case MapObjectType.OpenDoor:
             return ';';
         case MapObjectType.ClosedDoor:
             return ':';
         case MapObjectType.TreasureChest:
             return '+';
         case MapObjectType.Cosmetic:
             return '_';
         case MapObjectType.StairsDown:
             return '>';
         case MapObjectType.StairsUp:
             return '<';
         default:
             throw new System.ArgumentException("Unknown Type - ConvertMapObjectToChar");
     }
 }
コード例 #45
0
ファイル: Shop.cs プロジェクト: Sharknevercries/Tower-in-NCU
 public Shop(List<ImageUnit> frames, MapObjectType type)
     : base(frames, type)
 {
     _shop = Applet.Shop.GetInstance();
 }
コード例 #46
0
 public MapObject(List<ImageUnit> frames, MapObjectType type)
 {
     _frames = new List<ImageUnit>(frames);
     _currentFrame = 0;
     _type = type;
 }
コード例 #47
0
		public static List<MapPoi> GetPoiList(MapObjectType poiType)
		{
			using (var sc = new SqlConnection(ConnectionStringHelper.ConnectionString))
			{
				var cmd = new SqlCommand("sp_map_Poi_GetList", sc)
					          {
						          CommandType = CommandType.StoredProcedure
					          };

				cmd.Parameters.AddWithValue("@PoiType", (int)poiType);
				sc.Open();
				var reader = cmd.ExecuteReader();
				var poiList = new List<MapPoi>();
				while (reader.Read())
					poiList.Add(FillPoiFromReader(reader));

				return poiList;
			}
		}
コード例 #48
0
        public bool this[int x, int y, MapObjectType type, object obj]
        {
            get
            {

                if (Bounds.Height == Bounds.Width && Bounds.Width == 0)
                {
                    Console.WriteLine("Floor " + FloorMapID + " not loaded!!");
                    return true;
                }
                if (y >= Bounds.Height || x >= Bounds.Width || x < 0 || y < 0)
                    return false;

                if (Locations[x, y] == null)
                    Locations[x, y] = new FillStruct() { };

                FillStruct filltype = Locations[x, y];
                if (type == MapObjectType.InvalidCast)
                    return filltype.Full;
                if (filltype.Full)
                    return false;
                if (type == MapObjectType.Player)
                {
                    return true;
                }
                else if (type == MapObjectType.Monster)
                {
                    return filltype.Monsters == 0;
                }
                else if (type == MapObjectType.Item)
                {
                    return filltype.Item == null;
                }

                return false;
            }
            set
            {
                if (value)
                {
                    if (Bounds.Height == Bounds.Width && Bounds.Width == 0)
                        return;
                    if (y >= Bounds.Height || x >= Bounds.Width || x < 0 || y < 0)
                        return;

                    if (Locations[x, y] == null)
                        Locations[x, y] = new FillStruct() { };
                    if (type == MapObjectType.InvalidCast)
                    {
                        Locations[x, y].Full = false;
                    }
                    if (type == MapObjectType.Item)
                        Locations[x, y].Item = null;

                    if (type == MapObjectType.Monster)
                        Locations[x, y].Monsters = 0;
                }
                else
                {
                    if (y >= Bounds.Height || x >= Bounds.Width)
                        return;

                    if (Locations[x, y] == null)
                        Locations[x, y] = new FillStruct() { };
                    if (type == MapObjectType.InvalidCast)
                        Locations[x, y].Full = true;
                    if (obj != null)
                    {
                        if (obj is Interfaces.INpc)
                        {
                            Locations[x, y].Npc = obj as Interfaces.INpc;
                        }
                    }

                    if (type == MapObjectType.Item)
                        Locations[x, y].Item = obj as Network.GamePackets.FloorItem;

                    if (type == MapObjectType.Monster)
                        Locations[x, y].Monsters = 1;
                }
            }
        }
コード例 #49
0
ファイル: Floor.cs プロジェクト: Sharknevercries/Tower-in-NCU
 public void SetMapObject(Point position, MapObjectType type) => SetMapObject(position.Y, position.X, type);
コード例 #50
0
ファイル: Shop.cs プロジェクト: Sharknevercries/Tower-in-NCU
 public Shop(ImageUnit img, MapObjectType type)
     : base(img, type)
 {
     _shop = Applet.Shop.GetInstance();
 }
コード例 #51
0
ファイル: Stairs.cs プロジェクト: donblas/magecrawl
 public Stairs(Point position, bool stairsUp)
 {
     m_type = stairsUp ? MapObjectType.StairsUp : MapObjectType.StairsDown;
     m_position = position;
     m_guid = Guid.NewGuid();
 }
コード例 #52
0
ファイル: MapObjectFactory.cs プロジェクト: Uhha/Fo2
 public static MapObject GetMapObject(string name, MapObjectType objType, int position)
 {
     return new GenericMapObject(name, objType, position);
 }