Defines a logical collection of actors and tiles
This should be changed to have a collection of IRenderable and IThinkables
コード例 #1
0
ファイル: Map.cs プロジェクト: vogon/Zeplin
        /// <summary>
        /// Adds a new layer in the foreground.
        /// </summary>
        /// <returns>The index of the created layer</returns>
        public Layer NewLayer()
        {
            Layer newLayer = new Layer();
            PutLayer(newLayer, appendZ);

            return newLayer;
        }
コード例 #2
0
ファイル: Map.cs プロジェクト: vogon/Zeplin
        public void PutLayer(Layer layer, int z)
        {
            layers.Add(z, layer);

            if (z >= appendZ)
            {
                appendZ = z + 1;
            }
        }
コード例 #3
0
ファイル: Map.cs プロジェクト: vogon/Zeplin
        /// <summary>
        /// Adds a new layer at the specified index
        /// </summary>
        /// <param name="z">The z-position where the layer is to be added.</param>
        public Layer NewLayer(int z)
        {
            Layer newLayer = new Layer();
            PutLayer(newLayer, z);

            return newLayer;
        }
コード例 #4
0
ファイル: Map.cs プロジェクト: vogon/Zeplin
 /// <summary>
 /// Updates every layer owned by this map
 /// </summary>
 /// <param name="gameTime">The amount of time </param>
 public void Update(GameTime gameTime)
 {
     foreach (Layer l in layers.Values)
     {
         activeLayer = l;
         l.Update(gameTime);
     }
 }
コード例 #5
0
ファイル: Layer.cs プロジェクト: zumpiez/Zeplin
 /// <summary>
 /// Moves an actor to another layer
 /// </summary>
 /// <param name="movedActor">The actor to be moved</param>
 /// <param name="destinationLayer">The layer to move the actor to</param>
 /// <returns>True if the operation was successful, otherwise false</returns>
 public bool MoveTo(GameObject movedObject, Layer destinationLayer)
 {
     bool result = Remove(movedObject);
     if (result) destinationLayer.Add(movedObject);
     return result;
 }