Exemplo n.º 1
0
		public Map(IRegionEntityFactory factory, string name, string author, int width, int height)
			: this(factory) {
			this.Width = width;
			this.Height = height;

			Initialize(name, author, factory);
		}
Exemplo n.º 2
0
        public MapEntity CreateEntity(IRegionEntityFactory factory, IResourceContainer resources, bool scrollAffected)
        {
            MapEntity result = null;

            switch (EntityType)
            {
            case EntityType.None:
                result = new MapEntity(factory, scrollAffected);
                break;

            case EntityType.Building:
                result = new BuildingEntity(factory, scrollAffected);
                break;

            case EntityType.Player:
                result = new PlayerEntity(factory, scrollAffected);
                break;

            case EntityType.Npc:
                result = new NPCEntity(factory, scrollAffected);
                break;

            case EntityType.Door:
                //result = new EntityDoor();
                break;
            }

            if (result != null)
            {
                result.TemplateID = this.ID;
            }
            return(result);
        }
Exemplo n.º 3
0
        public Map(IRegionEntityFactory factory, string name, string author, int width, int height)
            : this(factory) {
            this.Width  = width;
            this.Height = height;

            Initialize(name, author, factory);
        }
Exemplo n.º 4
0
		private void Initialize(string name, string author, IRegionEntityFactory factory) {
			this.Name = name ?? "MAP_NO_NAME";
			this.Author = author ?? "Anonymous";

			this.Behaviors = new MockupTileBehavior[Width,Height];
			for (int i = 0; i < Width; i++) {
				for (int j = 0; j < Height; j++) {
					Behaviors[i, j] = new MockupTileBehavior(TileBehavior.Height2.Id);
				}
			}

			Fill(-1, 0);
		}
Exemplo n.º 5
0
		public MapEntity(IRegionEntityFactory factory, bool cameraAffected)
			: base(factory) {
			this.World = factory.World;
			this.Collidable = true;
			this.CameraAffected = cameraAffected;

			this.blendstate = BlendState.NonPremultiplied;
			this.Opacity = 1.0f;
			this.Scale = 1.0f;

			this.Shadow = true;
			this.Color = Color.White;

			Initialize();
		}
Exemplo n.º 6
0
        public MapEntity(IRegionEntityFactory factory, bool cameraAffected)
            : base(factory)
        {
            this.World          = factory.World;
            this.Collidable     = true;
            this.CameraAffected = cameraAffected;

            this.blendstate = BlendState.NonPremultiplied;
            this.Opacity    = 1.0f;
            this.Scale      = 1.0f;

            this.Shadow = true;
            this.Color  = Color.White;

            Initialize();
        }
Exemplo n.º 7
0
        private void Initialize(string name, string author, IRegionEntityFactory factory)
        {
            this.Name   = name ?? "MAP_NO_NAME";
            this.Author = author ?? "Anonymous";

            this.Behaviors = new MockupTileBehavior[Width, Height];
            for (int i = 0; i < Width; i++)
            {
                for (int j = 0; j < Height; j++)
                {
                    Behaviors[i, j] = new MockupTileBehavior(TileBehavior.Height2.Id);
                }
            }

            Fill(-1, 0);
        }
Exemplo n.º 8
0
		public BuildingEntity(IRegionEntityFactory factory, bool cameraAffected)
			: base(factory, cameraAffected) {
			Initialize();
		}
Exemplo n.º 9
0
		public MapEntity(IRegionEntityFactory factory, Map map, bool ScrollAffected) : this(factory, ScrollAffected) {
			this.Map = map;
		}
Exemplo n.º 10
0
 public MapEntity CreateEntity(IRegionEntityFactory factory, bool scrollAffected)
 {
     return(CreateEntity(factory, factory.World, scrollAffected));
 }
Exemplo n.º 11
0
 public MapEntity CreateEntity(IRegionEntityFactory factory)
 {
     return(CreateEntity(factory, true));
 }
Exemplo n.º 12
0
 public MapEntity(IRegionEntityFactory factory, Map map, bool ScrollAffected) : this(factory, ScrollAffected)
 {
     this.Map = map;
 }
Exemplo n.º 13
0
 public Map(IRegionEntityFactory factory)
     : this()
 {
     this.World = factory.World;
 }
Exemplo n.º 14
0
 public BuildingEntity(IRegionEntityFactory factory, bool cameraAffected)
     : base(factory, cameraAffected)
 {
     Initialize();
 }
Exemplo n.º 15
0
 public NPCEntity(IRegionEntityFactory factory, bool cameraAffected) : base(factory, cameraAffected)
 {
 }
Exemplo n.º 16
0
		public LivingEntity(IRegionEntityFactory factory, bool cameraAffected) : base(factory, cameraAffected) {
			this.Effects = new List<IEffect>();
		}
Exemplo n.º 17
0
		public Map(IRegionEntityFactory factory)
			: this() {
			this.World = factory.World;
		}
Exemplo n.º 18
0
		public NPCEntity(IRegionEntityFactory factory, bool cameraAffected) : base(factory, cameraAffected) {
		}
Exemplo n.º 19
0
		public MapEntity CreateEntity(IRegionEntityFactory factory) {
			return CreateEntity(factory, true);
		}
Exemplo n.º 20
0
		public MapEntity CreateEntity(IRegionEntityFactory factory, bool scrollAffected) {
			return CreateEntity(factory, factory.World, scrollAffected);
		}
Exemplo n.º 21
0
		public MapEntity CreateEntity(IRegionEntityFactory factory, IResourceContainer resources, bool scrollAffected) {
			MapEntity result = null;

			switch (EntityType) {
				case EntityType.None:
					result = new MapEntity(factory, scrollAffected);
					break;
				case EntityType.Building:
					result = new BuildingEntity(factory, scrollAffected);
					break;
				case EntityType.Player:
					result = new PlayerEntity(factory, scrollAffected);
					break;
				case EntityType.Npc:
					result = new NPCEntity(factory, scrollAffected);
					break;
				case EntityType.Door:
					//result = new EntityDoor();
					break;
			}

			if (result != null) result.TemplateID = this.ID;
			return result;
		}
Exemplo n.º 22
0
 public EntityIO(IBinaryIO stream, IRegionEntityFactory factory, bool ScrollAffected)
 {
     this._stream        = stream;
     this.factory        = factory;
     this.ScrollAffected = ScrollAffected;
 }
Exemplo n.º 23
0
 public LivingEntity(IRegionEntityFactory factory, bool cameraAffected) : base(factory, cameraAffected)
 {
     this.Effects = new List <IEffect>();
 }