public static MapAttribute CreateAttribute(MapAttributes type) { switch (type) { case MapAttributes.Walkable: return(null); case MapAttributes.Blocked: return(new MapBlockedAttribute()); case MapAttributes.Item: return(new MapItemAttribute()); case MapAttributes.ZDimension: return(new MapZDimensionAttribute()); case MapAttributes.NpcAvoid: return(new MapNpcAvoidAttribute()); case MapAttributes.Warp: return(new MapWarpAttribute()); case MapAttributes.Sound: return(new MapSoundAttribute()); case MapAttributes.Resource: return(new MapResourceAttribute()); case MapAttributes.Animation: return(new MapAnimationAttribute()); case MapAttributes.GrappleStone: return(new MapGrappleStoneAttribute()); case MapAttributes.Slide: return(new MapSlideAttribute()); } return(null); }
private Texture2D CreateMapPreview(MapAttributes ActiveMap) { int PreviewWidth = 200; int PreviewHeigh = 200; Texture2D MapPreview = new Texture2D(GraphicsDevice, PreviewWidth, PreviewHeigh); Color[] data = new Color[PreviewWidth * PreviewHeigh]; for (int pixel = 0; pixel < data.Length; pixel++) { data[pixel] = Color.FromNonPremultiplied(255, 255, 255, 255); } foreach (EventPoint ActiveEvent in ActiveMap.ListSpawns) { int X = (int)ActiveEvent.Position.X; int Y = (int)ActiveEvent.Position.Y * ActiveMap.MapSize.X; data[X + Y] = Color.FromNonPremultiplied(255, 255, 255, 255); } //set the color MapPreview.SetData(data); return(MapPreview); }
public Point GetSpawn(Maps map, int minX, int maxX, int minY, int maxY) { var x = 0; var y = 0; var z = 0; var mMap = ResourceCache.Instance.GetMaps()[map]; MapAttributes[] att = new MapAttributes[] { MapAttributes.Safe, MapAttributes.NoWalk, MapAttributes.Hide }; do { x = _rand.Next(minX, maxX); y = _rand.Next(minY, maxY); } while ( mMap.ContainsAny(x, y, att) && ++z < 10 ); if (z == 10) { throw new InvalidOperationException(); } return(new Point(x, y)); }
public void SetAttributes(int seed, int octaves, float period, float lacunarity, float persistence, int width, float height, Vector3 CellSize, float tree_spread) { attributes = new MapAttributes(seed, octaves, period, lacunarity, persistence, width, height, CellSize, tree_spread); }
// Called when the node enters the scene tree for the first time. public override void _Ready() { attributes = new MapAttributes(); Connect(nameof(ReadyToSendAttributes), this, nameof(JoiningEnabled)); }
public async Task RemoveAttribute(MapAttributes att, Rectangle area) { await RemoveAttribute(att, new Rectangle[] { area }); }
public async Task AddAttribute(MapAttributes att, Rectangle area) { await AddAttribute(att, new Rectangle[] { area }); }
public void ClearAttribute(int X, int Y, MapAttributes att) { SetByte(X, Y, (GetByte(X, Y) & (~att))); }
public void SetAttribute(int X, int Y, MapAttributes att) { SetByte(X, Y, (GetByte(X, Y) | att)); }
private void SetByte(int X, int Y, MapAttributes val) { Layer[Y * 256 + X] = val; }
private void SetMapAttributes(MapComponent mapComponent) { MapAttributes mapAttribute = _mapAttributesList.GetMapAttributeForTier(mapComponent.Tier); mapComponent.SetSpawnType(mapAttribute.SpawnType, mapAttribute.Time); }
public void ClearAttribute(int X, int Y, MapAttributes att) { Layer[Y * 256 + X] &= (byte)(~((byte)att)); }
public void SetAttribute(int X, int Y, MapAttributes att) { Layer[Y * 256 + X] |= (byte)att; }
public MapModel(int width, int height, MapAttributes attrs) : this(new MapTile(width, height), attrs) { }
public extern static ReactElement Map(MapAttributes properties, params ReactElementOrText[] children);