Example #1
0
        public override void drawVoxel(QuarterViewDrawer view, DrawContextEx canvas, Location loc, Point pt)
        {
            if (base.currentPos != loc)
            {
                return;
            }
            if (!contribution.canBeBuilt(loc))
            {
                return;
            }

            int         x;
            RoadPattern rp = TrafficVoxel.get(loc).road.pattern;

            if (rp.hasRoad(Direction.NORTH))
            {
                x = 0;
            }
            else
            {
                x = 1;
            }

            contribution.sprites[color, x].drawAlpha(canvas.surface, pt);
        }
Example #2
0
        /// <summary>
        /// Create a new road accessory at the specified location.
        /// </summary>
        /// <param name="loc"></param>
        public void Create(Location loc)
        {
            Debug.Assert(CanBeBuilt(loc));

            int         x;
            RoadPattern rp = TrafficVoxel.get(loc).road.pattern;

            if (rp.hasRoad(Direction.NORTH))
            {
                x = 1;
            }
            else
            {
                x = 0;
            }

            new RoadAccessory(TrafficVoxel.get(loc), this, x);
        }
Example #3
0
        /// <summary>
        /// Create a new car at the specified location.
        /// dir = 0 or 1
        /// </summary>
        /// <param name="loc"></param>
        public void create(Location loc)
        {
            Debug.Assert(canBeBuilt(loc));

            int         x;
            RoadPattern rp = TrafficVoxel.get(loc).road.pattern;

            if (rp.hasRoad(Direction.NORTH))
            {
                x = 0;
            }
            else
            {
                x = 1;
            }

            new DummyCar(TrafficVoxel.get(loc), this, currentColor, x);
        }