Пример #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);
		}
Пример #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);
        }
Пример #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);
        }
Пример #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);
		}
Пример #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();
		}
Пример #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();
        }
Пример #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);
        }
Пример #8
0
		public BuildingEntity(IRegionEntityFactory factory, bool cameraAffected)
			: base(factory, cameraAffected) {
			Initialize();
		}
Пример #9
0
		public MapEntity(IRegionEntityFactory factory, Map map, bool ScrollAffected) : this(factory, ScrollAffected) {
			this.Map = map;
		}
Пример #10
0
 public MapEntity CreateEntity(IRegionEntityFactory factory, bool scrollAffected)
 {
     return(CreateEntity(factory, factory.World, scrollAffected));
 }
Пример #11
0
 public MapEntity CreateEntity(IRegionEntityFactory factory)
 {
     return(CreateEntity(factory, true));
 }
Пример #12
0
 public MapEntity(IRegionEntityFactory factory, Map map, bool ScrollAffected) : this(factory, ScrollAffected)
 {
     this.Map = map;
 }
Пример #13
0
 public Map(IRegionEntityFactory factory)
     : this()
 {
     this.World = factory.World;
 }
Пример #14
0
 public BuildingEntity(IRegionEntityFactory factory, bool cameraAffected)
     : base(factory, cameraAffected)
 {
     Initialize();
 }
Пример #15
0
 public NPCEntity(IRegionEntityFactory factory, bool cameraAffected) : base(factory, cameraAffected)
 {
 }
Пример #16
0
		public LivingEntity(IRegionEntityFactory factory, bool cameraAffected) : base(factory, cameraAffected) {
			this.Effects = new List<IEffect>();
		}
Пример #17
0
		public Map(IRegionEntityFactory factory)
			: this() {
			this.World = factory.World;
		}
Пример #18
0
		public NPCEntity(IRegionEntityFactory factory, bool cameraAffected) : base(factory, cameraAffected) {
		}
Пример #19
0
		public MapEntity CreateEntity(IRegionEntityFactory factory) {
			return CreateEntity(factory, true);
		}
Пример #20
0
		public MapEntity CreateEntity(IRegionEntityFactory factory, bool scrollAffected) {
			return CreateEntity(factory, factory.World, scrollAffected);
		}
Пример #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;
		}
Пример #22
0
 public EntityIO(IBinaryIO stream, IRegionEntityFactory factory, bool ScrollAffected)
 {
     this._stream        = stream;
     this.factory        = factory;
     this.ScrollAffected = ScrollAffected;
 }
Пример #23
0
 public LivingEntity(IRegionEntityFactory factory, bool cameraAffected) : base(factory, cameraAffected)
 {
     this.Effects = new List <IEffect>();
 }