Ejemplo n.º 1
0
 public Room(Vector2 Size)
 {
     this.Size = Size;
     this.player = new Player(this, new Vector2(WALL_PADDING, Size.Y / 2));
     this.blocks = new BufferedList<GameObject>();
     this.blocks.Add(new GameObject(this, Vector2.Zero, Vector2.Zero, new Vector2(WALL_PADDING, Size.Y), TextureBin.Pixel));
     this.blocks.Add(new GameObject(this, new Vector2(Size.X - WALL_PADDING, 0), Vector2.Zero, new Vector2(WALL_PADDING, Size.Y), TextureBin.Pixel));
     this.blocks.Add(player);
     this.blockGroups = new List<BlockGroup>();
     this.snow = new BufferedList<Snow>();
     this.blocks.Add(new GameObject(this, new Vector2(0, Engine.screenResolution.Y - 200), new Vector2(Engine.screenResolution.X, Engine.screenResolution.Y)));
 }
Ejemplo n.º 2
0
        public ListControl(SectionFactory sectionFactory)
            : base(sectionFactory)
        {
            InitializeComponent();

            _itemList             = new BufferedList();
            _itemList.ListControl = this;
            _selectedItems        = new SelectedItemsCollection(this);

            _customiseListSection = SectionFactory.CreateCustomiseListSection(this);
            _listSection          = SectionFactory.CreateListSection(this);

            Canvas.Children.Add(_customiseListSection);
            Canvas.Children.Add(_listSection);
        }
Ejemplo n.º 3
0
 // Empties the contents of a room.
 public virtual void Reset()
 {
     this.floors = new List<Floor>();
     this.blocks = new List<Block>();
     this.cameraTarget = null;
     this.objects = new BufferedList<WorldObject>();
     this.nodes = new NodeManager();
     this.decalsBack = new BufferedList<Decal>();
     this.decalsFront = new BufferedList<Decal>();
 }
Ejemplo n.º 4
0
 protected RegistrationTargetBase()
 {
     Updateables = new BufferedLinkedList <UpdateContainer>();
     Renderables = new BufferedList <RenderContainer>();
 }
Ejemplo n.º 5
0
 internal void SetLayerInfo(BufferedList <RenderContainer> renderables)
 {
     this.renderables = renderables;
 }
Ejemplo n.º 6
0
        private float[] CalculateLighting(VertexPositionNormalTexture[] vertices, BufferedList<Light> lights)
        {
            float strength = 0;
            foreach (Light light in lights)
            {
                Vector3 lightRay = vertices[0].Position - light.position;
                float length = lightRay.Length();
                lightRay.Normalize();
                float dot = Vector3.Dot(vertices[0].Normal, -lightRay);
                float distAdjust = Math.Max(0, (light.distance - length) / light.distance);
                strength += Math.Max(0, dot * distAdjust * light.brightness);
            }

            return new float[] {strength};
        }
Ejemplo n.º 7
0
 public StateManager()
 {
     states = new BufferedList<State>();
     focusState = new List<State>();
 }