Example #1
0
        /// <summary>
        /// Flips the reactions to correspond with the building shape.
        /// </summary>
        /// <param name="reactions">Reactions.</param>
        /// <param name="hero">Hero.</param>
        public override void flipReactions(Reaction[,] reactions)
        {
            int x = (int)Origo.x;
            int y = (int)Origo.y;

            int[,] shape = Shapes.GetShape(ShapeType);

            for (int fy = 0; fy < shape.GetLength(0); fy++)
            {
                for (int fx = 0; fx < shape.GetLength(1); fx++)
                {
                    int dxx = x + Shapes.dx[fx];
                    int dyy = y + Shapes.dy[fy];

                    if (shape[fx, fy] == 1)
                    {
                        reactions[dxx, dyy] = new ResourceBuildingReaction(this, new Point(dxx, dyy));
                    }
                }
            }
        }
Example #2
0
 /// <summary>
 /// Makes the reaction.
 /// </summary>
 /// <returns>The reaction.</returns>
 public override Reaction makeReaction()
 {
     Reaction = new ResourceBuildingReaction(this, Origo);
     return(Reaction);
 }